The unit test function, responsible for performing one or more Test Assertions...
Syntax
The scope of unit test functions is manipulated before a test runs, so you cannot reference variables defined in the function's scope chain (closures will not work either).
If you want to reference variables external to the Unit Test function, pass them in via a settings object defined in the associated Test() invocation (see Example section below).
function() {
// code and assertions
}
Parameters
The unit test function has no parameters, but a number of variables and properties are available within it – see Notes below for details.
Return value
The return value is not processed.
Notes
Within the unit test, the following variables and properties are available:
similarTo( ) — A deep similarity checking assertion...
notSimilarTo( ) — A deep dissimilarity spotting assertion...
Test Signals — Signals are used to prematurely terminate Unit Tests...
REQUIRE( ) — Check whether a test or group of tests have passed. If the requirement fails, a RequireSignal will be sent which terminates the current test and marks it as failed.
ABORT( ) — Aborts the current test, marking it as failed in the process...
FINISH( ) — Terminates the test as if it had finished normally...