fix:Add missing test #2826 & fix related solution

This commit is contained in:
Omid Heidarzadeh 2022-01-22 22:29:27 +03:30
parent 1dc6dfbc7c
commit 82e5d13b89
2 changed files with 9 additions and 0 deletions

View file

@ -11,5 +11,6 @@ let ladder = {
}, },
showStep: function() { showStep: function() {
alert(this.step); alert(this.step);
return this;
} }
}; };

View file

@ -33,6 +33,14 @@ describe('Ladder', function() {
assert.equal(ladder.down().up().up().up().step, 2); assert.equal(ladder.down().up().up().up().step, 2);
}); });
it('showStep() should return this', function() {
assert.equal(ladder.showStep(), ladder);
});
it('up().up().down().showStep().down().showStep()', function () {
assert.equal(ladder.up().up().down().showStep().down().showStep().step, 0)
});
after(function() { after(function() {
ladder.step = 0; ladder.step = 0;
alert.restore(); alert.restore();