fix:Add missing test #2826 & fix related solution
This commit is contained in:
parent
1dc6dfbc7c
commit
82e5d13b89
2 changed files with 9 additions and 0 deletions
|
@ -11,5 +11,6 @@ let ladder = {
|
||||||
},
|
},
|
||||||
showStep: function() {
|
showStep: function() {
|
||||||
alert(this.step);
|
alert(this.step);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -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();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue