mirror of
https://github.com/littensy/charm.git
synced 2026-10-20 17:51:37 +00:00
refactor: add assertion error messages
This commit is contained in:
parent
bcf02a615f
commit
d56672384a
7 changed files with 74 additions and 80 deletions
|
|
@ -17,9 +17,9 @@ test("tracks atom state", function()
|
|||
local cleanup = root(function()
|
||||
source = useAtom(state)
|
||||
end)
|
||||
assert(source() == 0)
|
||||
assert(source() == 0, "should return 0")
|
||||
state(1)
|
||||
assert(source() == 1)
|
||||
assert(source() == 1, "should return 1")
|
||||
cleanup()
|
||||
end)
|
||||
|
||||
|
|
@ -31,9 +31,9 @@ test("accepts a selector", function()
|
|||
return 2 * state()
|
||||
end)
|
||||
end)
|
||||
assert(source() == 0)
|
||||
assert(source() == 0, "should return 0")
|
||||
state(1)
|
||||
assert(source() == 2)
|
||||
assert(source() == 2, "should return 2")
|
||||
cleanup()
|
||||
end)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue