verifySteps()


verifySteps( steps [, message ] )

Description: A helper assertion to verify the order and number of steps in a test.

The verifySteps() assertion compares a given array of string values (representing steps) and compares them with the order and values of previous step() calls. This assertion is helpful for verifying the order of execution for asynchronous flows.

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
QUnit.test( "step test", function( assert ) {
obj.start = function() {
assert.step('start');
};
obj.middle = function() {
assert.step('middle');
};
obj.end = function() {
assert.step('end');
};
return obj.process().then(function() {
assert.verifySteps(['start', 'middle', 'end']);
});
});