From 816bda90f64d6c7e20b51dd64c3f898aea71f33f Mon Sep 17 00:00:00 2001 From: takasmiley Date: Thu, 2 Mar 2017 12:51:19 +0900 Subject: [PATCH] Add test for #1274 case3 --- test/issues/issues-test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/issues/issues-test.js b/test/issues/issues-test.js index 3ab7e8ca6..2db9b2366 100644 --- a/test/issues/issues-test.js +++ b/test/issues/issues-test.js @@ -244,5 +244,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); + }); }); });