diff options
author | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
commit | fc7369835258467bf97eb64f184b93691f9a9fd5 (patch) | |
tree | daabd60089d2dd76d9f5fb416b005fbe159c799d /www/crm/wp-content/plugins/civicrm/civicrm/bower_components/qunit/addons/step/qunit-step.js |
first commit
Diffstat (limited to 'www/crm/wp-content/plugins/civicrm/civicrm/bower_components/qunit/addons/step/qunit-step.js')
-rw-r--r-- | www/crm/wp-content/plugins/civicrm/civicrm/bower_components/qunit/addons/step/qunit-step.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/qunit/addons/step/qunit-step.js b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/qunit/addons/step/qunit-step.js new file mode 100644 index 00000000..1ed3ff06 --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/qunit/addons/step/qunit-step.js @@ -0,0 +1,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; +}); |