From 0ee6a4e9f606b30869804936dfeebf2d130f3ade Mon Sep 17 00:00:00 2001 From: --local Date: Mon, 6 Aug 2018 20:18:43 +0200 Subject: [PATCH] Add test for #1796, failing to stub Array.prototype.sort This was fixed in c2c78143ffd381418b9847e8518cadd0741dfddc --- test/issues/issues-test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/issues/issues-test.js b/test/issues/issues-test.js index a3166b5ae..ab4a34a62 100644 --- a/test/issues/issues-test.js +++ b/test/issues/issues-test.js @@ -508,4 +508,12 @@ describe("issues", function () { sinon.assert.calledWith(spy, secondObj); }); }); + + describe("#1796 - cannot stub Array.prototype.sort", function () { + it("it should not fail with RangeError", function () { + var stub = sinon.stub(Array.prototype, "sort"); + [1, 2, 3].sort(); + stub.restore(); + }); + }); });