summaryrefslogtreecommitdiff
path: root/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/qunit/addons/step/qunit-step.js
blob: 1ed3ff066c960588f368de38fbd106dbfa4ab40d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
QUnit.extend( QUnit, {

	/**
	 * Check the sequence/order
	 *
	 * @example step(1); setTimeout(function () { step(3); }, 100); step(2);
	 * @param Number expected  The excepted step within the test()
	 * @param String message (optional)
	 */
	step: function (expected, message) {
		this.config.current.step++; // increment internal step counter.
		if (typeof message === "undefined") {
			message = "step " + expected;
		}
		var actual = this.config.current.step;
		QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
	}
});

/**
 * Reset the step counter for every test()
 */
QUnit.testStart(function () {
	this.config.current.step = 0;
});