Skip to content

Commit

Permalink
Modified test.js to guard against lack of support for Set and Map in …
Browse files Browse the repository at this point in the history
…the module.js used by Travis CI
  • Loading branch information
andrew brown committed May 3, 2016
1 parent c05eefe commit f4c9859
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,16 @@
assert.equal(_.isEqual({a: NaN}, {a: NaN}), true, 'NaN and NaN are equal as object values');

// SameValueZero tests for isEq function used for sets and maps
var set0 = new Set().add(0);
var setNeg0 = new Set().add(-0);
var map0 = new Map().set(0, 0);
var mapNeg0 = new Map().set(-0, 0);
assert.equal(_.isEqual(set0, setNeg0), true, 'In sets 0 and -0 are equal');
assert.equal(_.isEqual(map0, mapNeg0), true, 'In maps keys of 0 and -0 are equal');
if (typeof Set !== 'undefined') {
var set0 = new Set().add(0);
var setNeg0 = new Set().add(-0);
assert.equal(_.isEqual(set0, setNeg0), true, 'In sets 0 and -0 are equal');
}
if (typeof Map !== 'undefined') {
var map0 = new Map().set(0, 0);
var mapNeg0 = new Map().set(-0, 0);
assert.equal(_.isEqual(map0, mapNeg0), true, 'In maps keys of 0 and -0 are equal');
}


if (typeof Symbol !== 'undefined') {
Expand Down

0 comments on commit f4c9859

Please sign in to comment.