What is obj in the QUnit code example?
QUnit
I read this web-page. It contains code example:
- 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']);
- });
- });
What is obj in this code example?
I don't understand how to use `assert.verifySteps` method. This is my attempt:
- QUnit.test( "step test", function( assert ) {
- let obj = {};
- obj.start = function() {
- assert.step('start');
- };
- obj.middle = function() {
- assert.step('middle');
- };
- obj.end = function() {
- assert.step('end');
- };
- return assert.verifySteps.bind(obj)(['start', 'middle', 'end']);
- });
Thank you.