Assertions run test functions, provide helpers, and record the results of the tests.
Example
this.assert_equal("Tiger", this.name, "Tiger was expected");
this.assert_not_null(this.title, "Title was null");
this.assert_null(this.obj, "Expected to be null");
this.assert(x_value > 200);
Prototype Methods
assert
assert(expression, message) -> undefined
Asserts the expression exists in the same way that if(expression) does. If the expression doesn't exist reports the error.
Calls the next function in the array after a certain delay. Used at the end
of a test function after an asynchronous
event has been initiated, such as an Ajax call or an animation.
{Object} - Optional parameters. If provided, this is passed into the function specified by fname as its parameter.
{Number} - An optional delay, after which the specified function is called. The default is 0.5 seconds.
{String} - An optional function name. If none is give, defaults to the name of the function sequentially next in the array of test functions.
next_callback
next_callback(fname, delay) -> Function
Calls the next function in the array after a certain delay. Used in conjunction with asynchronous functions that use callback functions,
such as an Ajax call or the Drag event.