Merge remote-tracking branch 'odoo/7.0' into 7.0
[odoo/odoo.git] / addons / web / static / test / qunit-doc.js
1 /**
2  * Defines a module scope (which lasts until the next call to module).
3  *
4  * This module scopes implies setup and teardown callbacks running for each test.
5  *
6  * @function
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
11  */
12 var module;
13 /**
14  * Defines a given test to run. Runs all the assertions present in the test
15  *
16  * @function
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)
20  */
21 var test;
22 /**
23  * Defines an asynchronous test: equivalent to calling stop() at the start of
24  * a normal test().
25  *
26  * The test code needs to restart the test runner via start()
27  *
28  * @function
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)
32  */
33 var asyncTest;
34 /**
35  * The most basic boolean assertion (~assertTrue or assert).
36  *
37  * Passes if its argument is truthy
38  *
39  * @function
40  * @param {Boolean} state an arbitrary expression, evaluated in a boolean context
41  * @param {String} [message] the message to output with the assertion result
42  */
43 var ok;
44 /**
45  * Equality assertion (~assertEqual)
46  *
47  * Passes if both arguments are equal (via <code>==</code>)
48  *
49  * @function
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
53  */
54 var equal;
55 /**
56  * Inequality assertion (~assertNotEqual)
57  *
58  * Passes if the arguments are different (via <code>!=</code>)
59  *
60  * @function
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
64  */
65 var notEqual;
66 /**
67  * Recursive equality assertion.
68  *
69  * Works on primitive types using <code>===</code> and traversing through
70  * Objects and Arrays as well checking their components
71  *
72  * @function
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
76  */
77 var deepEqual;
78 /**
79  * Recursive inequality assertion.
80  *
81  * Works on primitive types using <code>!==</code> and traversing through
82  * Objects and Arrays as well checking their components
83  *
84  * @function
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
88  */
89 var notDeepEqual;
90 /**
91  * Strict equality assertion (~assertEqual)
92  *
93  * Passes if both arguments are identical (via <code>===</code>)
94  *
95  * @function
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
99  */
100 var strictEqual;
101 /**
102  * Strict inequality assertion (~assertNotEqual)
103  *
104  * Passes if both arguments are identical (via <code>!==</code>)
105  *
106  * @function
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
110  */
111 var notStrictEqual;
112 /**
113  * Passes if the provided block raised an exception.
114  *
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
121  *
122  * @function
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
126  */
127 var raises;
128 /**
129  * Starts running the test runner again from the point where it was
130  * <code>stop</code>ped.
131  *
132  * Used to resume testing after a callback.
133  *
134  * @function
135  */
136 var start;
137 /**
138  * Stops the test runner in order to wait for an asynchronous test to run
139  *
140  * @function
141  * @param {Number} [timeout] fails the test after the timeout triggers, only for debugging tests
142  */
143 var stop;