Skip to content

Commit

Permalink
Add test for sinonjs#1274 case3
Browse files Browse the repository at this point in the history
  • Loading branch information
takasmiley committed Jun 28, 2017
1 parent 0e77b31 commit 76ac773
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/issues/issues-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,5 +314,17 @@ describe("issues", function () {
assert.equals(spy.withArgs(1, 1).callCount, 1);
assert.equals(spy.withArgs(1, 2).callCount, 1);
});
it("case3: should work on stub", function () {
var stub = sinon.stub();
stub.returns(0);
stub.withArgs(1, 1).returns(2);
stub.withArgs(1).returns(1);

assert.equals(stub(), 0);
assert.equals(stub(1), 1);
assert.equals(stub(1, 1), 2);
assert.equals(stub(1, 1, 1), 2);
assert.equals(stub(2), 0);
});
});
});

0 comments on commit 76ac773

Please sign in to comment.