stop()


stop( [increment ] )

Description: Increase the number of start() calls the testrunner should wait for before continuing.

  • stop( [increment ] )

    • increment (default: 1)
      Type: Integer
      Optional argument to increase the async test depth with multiple steps at once.

When your async test has multiple exit points, call stop() multiple times or use the increment argument.

Example:

A test that waits 150ms for an async operation to finish, then asserts the result.

1
2
3
4
5
6
7
8
test( "a test", function() {
stop();
asyncOp();
setTimeout(function() {
equals( asyncOp.result, "someExpectedValue" );
start();
}, 150 );
});