171
edits
(Wrote up a unit testing proposal in normative terms.) |
m (typos and refinements) |
||
| Line 30: | Line 30: | ||
The truth assertion tests whether a value is identical to <tt>true</tt>, as determined by the <tt>===</tt> operator. | The truth assertion tests whether a value is identical to <tt>true</tt>, as determined by the <tt>===</tt> operator. | ||
assert.isTrue( | assert.isTrue(actual, [message]); | ||
Falsity: | Falsity: | ||
assert.isFalse( | assert.isFalse(actual, [message]); | ||
The nullity assertion tests whether a value is identical to <tt>null</tt>, as determined by the <tt>===</tt> operator. <tt>undefined</tt> is | The nullity assertion tests whether a value is identical to <tt>null</tt>, as determined by the <tt>===</tt> operator. <tt>undefined</tt> is equivalent but not identical to <tt>null</tt>, so checking whether a value is null or undefined can be determined by <tt>assert.eq(value)</tt>. | ||
assert.isNull( | assert.isNull(actual, [message]); | ||
The truthiness assertion tests whether a value is equivalent to <tt>true</tt>, as determined by the <tt>==</tt> operator. | The truthiness assertion tests whether a value is equivalent to <tt>true</tt>, as determined by the <tt>==</tt> operator. | ||
assert.eqTrue( | assert.eqTrue(actual, [message]); | ||
Falsiness: | Falsiness: | ||
assert.eqFalse( | assert.eqFalse(actual, [message]); | ||
Not a number: | Not a number: | ||
edits