2 * Defines a module scope (which lasts until the next call to module).
4 * This module scopes implies setup and teardown callbacks running for each test.
7 * @param {String} name the name of the module
8 * @param {Object} [lifecycle] callbacks to run before and after each test of the module
9 * @param {Function} lifecycle.setup function running before each test of this module
10 * @param {Function} lifecycle.teardown function running after each test of this module
14 * Defines a given test to run. Runs all the assertions present in the test
17 * @param {String} name the name of the test
18 * @param {Number} [expected] number of assertions expected to run in this test (useful for asynchronous tests)
19 * @param {Function} test the testing code to run, holding a sequence of assertions (at least one)
23 * Defines an asynchronous test: equivalent to calling stop() at the start of
26 * The test code needs to restart the test runner via start()
29 * @param {String} name the name of the test
30 * @param {Number} [expected] number of assertions expected to run in this test (useful for asynchronous tests)
31 * @param {Function} test the testing code to run, holding a sequence of assertions (at least one)
35 * The most basic boolean assertion (~assertTrue or assert).
37 * Passes if its argument is truthy
40 * @param {Boolean} state an arbitrary expression, evaluated in a boolean context
41 * @param {String} [message] the message to output with the assertion result
45 * Equality assertion (~assertEqual)
47 * Passes if both arguments are equal (via <code>==</code>)
50 * @param {Object} actual the object to check for correctness (processing result)
51 * @param {Object} expected the object to check against
52 * @param {String} [message] message output with the assertion result
56 * Inequality assertion (~assertNotEqual)
58 * Passes if the arguments are different (via <code>!=</code>)
61 * @param {Object} actual the object to check for correctness (processing result)
62 * @param {Object} expected the object to check against
63 * @param {String} [message] message output with the assertion result
67 * Recursive equality assertion.
69 * Works on primitive types using <code>===</code> and traversing through
70 * Objects and Arrays as well checking their components
73 * @param {Object} actual the object to check for correctness (processing result)
74 * @param {Object} expected the object to check against
75 * @param {String} [message] message output with the assertion result
79 * Recursive inequality assertion.
81 * Works on primitive types using <code>!==</code> and traversing through
82 * Objects and Arrays as well checking their components
85 * @param {Object} actual the object to check for correctness (processing result)
86 * @param {Object} expected the object to check against
87 * @param {String} [message] message output with the assertion result
91 * Strict equality assertion (~assertEqual)
93 * Passes if both arguments are identical (via <code>===</code>)
96 * @param {Object} actual the object to check for correctness (processing result)
97 * @param {Object} expected the object to check against
98 * @param {String} [message] message output with the assertion result
102 * Strict inequality assertion (~assertNotEqual)
104 * Passes if both arguments are identical (via <code>!==</code>)
107 * @param {Object} actual the object to check for correctness (processing result)
108 * @param {Object} expected the object to check against
109 * @param {String} [message] message output with the assertion result
113 * Passes if the provided block raised an exception.
115 * The <code>expect</code> argument can be provided to perform further assertion checks on the exception itself:
116 * * If it's a <code>RegExp</code> test the exception against the regexp (message?)
117 * * If it's a constructor, check if the exception is an instance of it
118 * * If it's an other type of function, call it with the exception as first parameter
119 * - If the function returns true, the assertion validates
120 * - Otherwise it fails
123 * @param {Function} block function which should raise an exception when called
124 * @param {Object} [expect] a RegExp, a constructor or a Function
125 * @param {String} [message] message output with the assertion result
129 * Starts running the test runner again from the point where it was
130 * <code>stop</code>ped.
132 * Used to resume testing after a callback.
138 * Stops the test runner in order to wait for an asynchronous test to run
141 * @param {Number} [timeout] fails the test after the timeout triggers, only for debugging tests