Is there an equivalent to assertFalse in nodeunit?
-
15-06-2021 - |
Question
Using nodeunit is there an assert to check for false values? Other testing frameworks have something like assertFalse
, should I use something like:
test.ok(!shouldBeFalse());
or
test.equals(shouldBeFalse(), false);
Or is there a project that adds a false assertion?
La solution
If you want to be sure only boolean
false
is matched than use strictEqual
:
test.strictEqual(shouldBeFalse(), false)
Otherwise equal
is ok too.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow