HTML and CSS Reference
In-Depth Information
Table 9-2. QUnit Assertions
Assertion
Description
ok( state , message )
Checks to see whether a value (state) is true;
if it is true, the assertion will pass.
equal( actual , expected , message )
Checks to see whether the actual value is
equal to the expected value.
notEqual( actual , expected , message )
Checks to see whether the actual value is
not equal to the expected value.
deepEqual( actual , expected , message ) Checks to see whether the actual value is
equal to the expected value. This assertion
is particularly useful when you would like to
compare instantiated objects and their
values.
notDeepEqual( actual , expected , message ) Checks to see whether the actual value is
not equal to the expected value. This
assertion is particularly useful when you
would like to compare instantiated objects
and their values.
strictEqual( actual , expected , message ) Checks to see whether the actual value is
equal to the expected value. This is much
stricter. For instance, if you set actual to
"10" (with the quotation marks, this makes
10 a string), and the expected to 10 (a
number), the assertion will fail.
strictNotEqual( actual , expected ,
message )
Checks to see whether the actual value is
not equal to the expected value. This is
much stricter. For instance, if you set actual
to "10" (with the quotation marks, this
makes 10 a string), and the expected to 10 (a
number), the assertion will fail.
raises( block , expected , message )
Checks to see whether code executed
within the block raises an exception, and
whether that exception matches the
expected value.
 
Search WWH ::




Custom Search