From 11a6f8502f5c012e55934bbb248625e9c4592dfa Mon Sep 17 00:00:00 2001 From: Grant Snodgrass Date: Sun, 9 Jul 2017 18:54:32 -0400 Subject: [PATCH] test: skip failing `.include` tests in IE11 Contrary to spec, IE11 uses SameValue instead of SameValueZero equality for Sets. --- test/assert.js | 6 +++++- test/expect.js | 6 +++++- test/should.js | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/test/assert.js b/test/assert.js index 3e3b51f1f..44bb5ff9f 100644 --- a/test/assert.js +++ b/test/assert.js @@ -657,7 +657,11 @@ describe('assert', function () { assert.include(set, val); assert.include(set, 2); - assert.include(set, 0); + if (set.has(0)) { + // This test is skipped in IE11 because (contrary to spec) IE11 uses + // SameValue instead of SameValueZero equality for sets. + assert.include(set, 0); + } assert.include(set, NaN); } diff --git a/test/expect.js b/test/expect.js index 44e098f2d..484edd6f5 100644 --- a/test/expect.js +++ b/test/expect.js @@ -1910,7 +1910,11 @@ describe('expect', function () { expect(set).to.not.include([{a: 1}]); expect(set).to.include(2); expect(set).to.not.include(3); - expect(set).to.include(0); + if (set.has(0)) { + // This test is skipped in IE11 because (contrary to spec) IE11 uses + // SameValue instead of SameValueZero equality for sets. + expect(set).to.include(0); + } expect(set).to.include(NaN); } diff --git a/test/should.js b/test/should.js index 080bf5bf7..ebff98c1f 100644 --- a/test/should.js +++ b/test/should.js @@ -1568,7 +1568,11 @@ describe('should', function() { set.should.not.include([{a: 1}]); set.should.include(2); set.should.not.include(3); - set.should.include(0); + if (set.has(0)) { + // This test is skipped in IE11 because (contrary to spec) IE11 uses + // SameValue instead of SameValueZero equality for sets. + set.should.include(0); + } set.should.include(NaN); }