Skip to content

Commit

Permalink
Fix tests for IE11
Browse files Browse the repository at this point in the history
IE11 doesn't have support for the iterable argument to the constructor
  • Loading branch information
mroderick committed Jan 21, 2018
1 parent c5dfaae commit f2d5902
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions test/match-test.js
Expand Up @@ -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));
});
}
});
Expand Down Expand Up @@ -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));
});
}
});
Expand Down

0 comments on commit f2d5902

Please sign in to comment.