From f2d5902d2dfdc07904cc57943cb1efe0060c9d63 Mon Sep 17 00:00:00 2001 From: Morgan Roderick Date: Sun, 21 Jan 2018 12:45:09 +0100 Subject: [PATCH] Fix tests for IE11 IE11 doesn't have support for the iterable argument to the constructor --- test/match-test.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/test/match-test.js b/test/match-test.js index b2e780c9b..380f5faa7 100644 --- a/test/match-test.js +++ b/test/match-test.js @@ -678,14 +678,20 @@ describe("sinonMatch", function () { if (typeof Set === "function") { it("matches an iterable if the predicate is true for every element", function () { var every = sinonMatch.every(sinonMatch.number); + var set = new Set(); + set.add(1); + set.add(2); - assert(every.test(new Set([1, 2]))); + assert(every.test(set)); }); it("fails if the predicate is false for some of the iterable elements", function () { var every = sinonMatch.every(sinonMatch.number); + var set = new Set(); + set.add(1); + set.add("b"); - refute(every.test(new Set([1, "b"]))); + refute(every.test(set)); }); } }); @@ -751,14 +757,21 @@ describe("sinonMatch", function () { if (typeof Set === "function") { it("matches an iterable if the predicate is true for some element", function () { var some = sinonMatch.some(sinonMatch.number); + var set = new Set(); + set.add(1); + set.add("b"); - assert(some.test(new Set([1, "b"]))); + assert(some.test(set)); }); it("fails if the predicate is false for all of the iterable elements", function () { var some = sinonMatch.some(sinonMatch.number); + var set = new Set(); + set.add("a"); + set.add("b"); - refute(some.test(new Set(["a", "b"]))); + + refute(some.test(set)); }); } });