From eae7d4a66b5b6d6d054520e395fb92c3db59db99 Mon Sep 17 00:00:00 2001 From: Marc Redemske Date: Sun, 7 Oct 2018 15:51:46 +0200 Subject: [PATCH] test(#1887) (#1918) * test(#1887): add test Adding the test case described in #1887 * test(#1887): set test title according to issue title --- 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 77c2cace1..0997ae431 100644 --- a/test/issues/issues-test.js +++ b/test/issues/issues-test.js @@ -548,4 +548,16 @@ describe("issues", function () { assert.same(result, undefined); //[ERR_ASSERTION]: 5 === undefined }); }); + + describe("#1887", function () { + it("should not break stub behavior using multiple `match.any`", function () { + var stub = sinon.stub(); + + stub.withArgs(sinon.match.any, sinon.match.any, sinon.match("a")).returns("a"); + stub.withArgs(sinon.match.any, sinon.match.any, sinon.match("b")).returns("b"); + + assert.equals(stub({}, [], "a"), "a"); + assert.equals(stub({}, [], "b"), "b"); + }); + }); });