874
edits
(filled out test object more) |
(→Test Modules: Finished this section) |
||
| Line 114: | Line 114: | ||
Calls the function ''func'' with no arguments, expecting an exception to be raised. If nothing is raised, marks the test as failing. If an exception is raised, the exception's <tt>message</tt> property is compared with ''predicate'': if ''predicate'' is a string, then a simple equality comparison is done with <tt>message</tt>. Otherwise, if ''predicate'' is a regular expression, <tt>message</tt> is tested against it. Depending on the outcome, a test is marked as passing or failing, and ''message'' is logged. | Calls the function ''func'' with no arguments, expecting an exception to be raised. If nothing is raised, marks the test as failing. If an exception is raised, the exception's <tt>message</tt> property is compared with ''predicate'': if ''predicate'' is a string, then a simple equality comparison is done with <tt>message</tt>. Otherwise, if ''predicate'' is a regular expression, <tt>message</tt> is tested against it. Depending on the outcome, a test is marked as passing or failing, and ''message'' is logged. | ||
<tt>test.'''waitUntilDone'''([''timeout''])</tt> | |||
Puts the test runner into asynchronous testing mode, waiting up to ''timeout'' milliseconds for <tt>test.done()</tt> to be called. This is intended for use in situations where a test suite schedules a callback, calls <tt>test.waitUntilDone</tt>, and then calls <tt>test.done()</tt> in the callback. | |||
<tt>test.'''done'''()</tt> | |||
Marks a test as being complete. Assumes a previous call to <tt>test.waitUntilDone()</tt>. | |||
==== Program Modules ==== | ==== Program Modules ==== | ||
edits