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() {
alert(this.step);
return this;
}
};

View file

@ -32,6 +32,14 @@ describe('Ladder', function() {
it('down().up().up().up() ', function() {
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() {
ladder.step = 0;