jquery/external/qunit-assert-step/qunit-assert-step.js
Thomas Tortorini 3dd3d1357d Effects: Finish should call progress
Fixes gh-2283
Closes gh-2292
2015-09-08 02:40:54 +02:00

27 lines
758 B
JavaScript

QUnit.extend( QUnit.assert, {
/**
* Check the sequence/order
*
* @example test('Example unit test', function(assert) { assert.step(1); setTimeout(function () { assert.step(3); start(); }, 100); assert.step(2); stop(); });
* @param Number expected The excepted step within the test()
* @param String message (optional)
*/
step: function (expected, message) {
// increment internal step counter.
QUnit.config.current.step++;
if (typeof message === "undefined") {
message = "step " + expected;
}
var actual = QUnit.config.current.step;
QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
}
});
/**
* Reset the step counter for every test()
*/
QUnit.testStart(function () {
QUnit.config.current.step = 0;
});