Properly skip Set tests in browsers that don't really support it
This commit is contained in:
@@ -369,12 +369,12 @@ describe("matchersUtil", function() {
|
||||
});
|
||||
|
||||
it("passes when comparing two empty sets", function() {
|
||||
if (typeof Set === 'undefined') { return; }
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
expect(jasmineUnderTest.matchersUtil.equals(new Set(), new Set())).toBe(true);
|
||||
});
|
||||
|
||||
it("passes when comparing identical sets", function() {
|
||||
if (typeof Set === 'undefined') { return; }
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
var setA = new Set([6, 5]);
|
||||
var setB = new Set();
|
||||
setB.add(6);
|
||||
@@ -383,26 +383,25 @@ describe("matchersUtil", function() {
|
||||
});
|
||||
|
||||
it("fails for sets with different elements", function() {
|
||||
if (typeof Set === 'undefined') { return; }
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
var setA = new Set([6, 3, 5]);
|
||||
var setB = new Set([6, 4, 5]);
|
||||
expect(jasmineUnderTest.matchersUtil.equals(setA, setB)).toBe(false);
|
||||
});
|
||||
|
||||
it("fails for sets of different size", function() {
|
||||
if (typeof Set === 'undefined') { return; }
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
var setA = new Set([6, 3]);
|
||||
var setB = new Set([6, 4, 5]);
|
||||
expect(jasmineUnderTest.matchersUtil.equals(setA, setB)).toBe(false);
|
||||
});
|
||||
|
||||
it("fails for sets with different insertion order", function() {
|
||||
if (typeof Set === 'undefined') { return; }
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
var setA = new Set([3, 6]);
|
||||
var setB = new Set([6, 3]);
|
||||
expect(jasmineUnderTest.matchersUtil.equals(setA, setB)).toBe(false);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("contains", function() {
|
||||
|
||||
Reference in New Issue
Block a user