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.
function(settings) {
// code and assertions
}
Parameters
Parameter
Type
Notes
API Version
settings
Variant
The settings data passed in to Test(), if applicable.
1.0
Return value
The return value is not processed.
Notes
Within the unit test, the following additional variables and properties are also 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...