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 authored and Franck Romano committed Oct 1, 2019
1 parent 256361a commit 0657b50
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 0657b50

Please sign in to comment.