Removed support for IE 10 and Safari 8
This commit is contained in:
@@ -55,11 +55,11 @@ Jasmine tests itself across many browsers (Safari, Chrome, Firefox, Microsoft Ed
|
||||
| Environment | Supported versions |
|
||||
|-------------------|--------------------|
|
||||
| Node | 10, 12, 14 |
|
||||
| Safari | 8-14 |
|
||||
| Safari | 9-14 |
|
||||
| Chrome | Evergreen |
|
||||
| Firefox | Evergreen, 68, 78 |
|
||||
| Edge | Evergreen |
|
||||
| Internet Explorer | 10, 11 |
|
||||
| Internet Explorer | 11 |
|
||||
|
||||
For evergreen browsers, each version of Jasmine is tested against the version of the browser that is available to us
|
||||
at the time of release. Other browsers, as well as older & newer versions of some supported browsers, are likely to work.
|
||||
|
||||
@@ -298,7 +298,6 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
||||
return (
|
||||
obj !== null &&
|
||||
typeof obj !== 'undefined' &&
|
||||
typeof jasmineGlobal.Map !== 'undefined' &&
|
||||
obj.constructor === jasmineGlobal.Map
|
||||
);
|
||||
};
|
||||
@@ -307,7 +306,6 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
||||
return (
|
||||
obj !== null &&
|
||||
typeof obj !== 'undefined' &&
|
||||
typeof jasmineGlobal.Set !== 'undefined' &&
|
||||
obj.constructor === jasmineGlobal.Set
|
||||
);
|
||||
};
|
||||
@@ -4748,8 +4746,8 @@ getJasmineRequireObj().MatchersUtil = function(j$) {
|
||||
// If we have an instance of ArrayBuffer the Uint8Array ctor
|
||||
// will be defined as well
|
||||
return self.eq_(
|
||||
new Uint8Array(a), // eslint-disable-line compat/compat
|
||||
new Uint8Array(b), // eslint-disable-line compat/compat
|
||||
new Uint8Array(a),
|
||||
new Uint8Array(b),
|
||||
aStack,
|
||||
bStack,
|
||||
diffBuilder
|
||||
|
||||
@@ -90,11 +90,11 @@
|
||||
}
|
||||
},
|
||||
"browserslist": [
|
||||
"Safari >= 8",
|
||||
"Safari >= 9",
|
||||
"last 2 Chrome versions",
|
||||
"last 2 Firefox versions",
|
||||
"Firefox 68",
|
||||
"last 2 Edge versions",
|
||||
"IE >= 10"
|
||||
"IE >= 11"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ run_browser() {
|
||||
passfile=`mktemp -t jasmine-results.XXXXXX` || exit 1
|
||||
failfile=`mktemp -t jasmine-results.XXXXXX` || exit 1
|
||||
run_browser "internet explorer" 11
|
||||
run_browser "internet explorer" 10
|
||||
run_browser firefox latest
|
||||
run_browser firefox 78
|
||||
run_browser firefox 68
|
||||
@@ -34,7 +33,6 @@ run_browser safari 12
|
||||
run_browser safari 11
|
||||
run_browser safari 10
|
||||
run_browser safari 9
|
||||
run_browser safari 8
|
||||
run_browser MicrosoftEdge latest
|
||||
|
||||
echo
|
||||
|
||||
@@ -18,8 +18,7 @@ describe('PrettyPrinter', function() {
|
||||
|
||||
describe('stringify sets', function() {
|
||||
it('should stringify sets properly', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
var set = new Set(); // eslint-disable-line compat/compat
|
||||
var set = new Set();
|
||||
set.add(1);
|
||||
set.add(2);
|
||||
var pp = jasmineUnderTest.makePrettyPrinter();
|
||||
@@ -27,12 +26,11 @@ describe('PrettyPrinter', function() {
|
||||
});
|
||||
|
||||
it('should truncate sets with more elements than jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
var originalMaxSize = jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH;
|
||||
|
||||
try {
|
||||
jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH = 2;
|
||||
var set = new Set(); // eslint-disable-line compat/compat
|
||||
var set = new Set();
|
||||
set.add('a');
|
||||
set.add('b');
|
||||
set.add('c');
|
||||
@@ -46,20 +44,18 @@ describe('PrettyPrinter', function() {
|
||||
|
||||
describe('stringify maps', function() {
|
||||
it('should stringify maps properly', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
var map = new Map(); // eslint-disable-line compat/compat
|
||||
var map = new Map();
|
||||
map.set(1, 2);
|
||||
var pp = jasmineUnderTest.makePrettyPrinter();
|
||||
expect(pp(map)).toEqual('Map( [ 1, 2 ] )');
|
||||
});
|
||||
|
||||
it('should truncate maps with more elements than jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
var originalMaxSize = jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH;
|
||||
|
||||
try {
|
||||
jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH = 2;
|
||||
var map = new Map(); // eslint-disable-line compat/compat
|
||||
var map = new Map();
|
||||
map.set('a', 1);
|
||||
map.set('b', 2);
|
||||
map.set('c', 3);
|
||||
|
||||
@@ -30,27 +30,21 @@ describe('Any', function() {
|
||||
});
|
||||
|
||||
it('matches a Map', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
|
||||
var any = new jasmineUnderTest.Any(Map);
|
||||
|
||||
expect(any.asymmetricMatch(new Map())).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(any.asymmetricMatch(new Map())).toBe(true);
|
||||
});
|
||||
|
||||
it('matches a Set', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var any = new jasmineUnderTest.Any(Set);
|
||||
|
||||
expect(any.asymmetricMatch(new Set())).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(any.asymmetricMatch(new Set())).toBe(true);
|
||||
});
|
||||
|
||||
it('matches a TypedArray', function() {
|
||||
jasmine.getEnv().requireFunctioningTypedArrays();
|
||||
var any = new jasmineUnderTest.Any(Uint32Array);
|
||||
|
||||
var any = new jasmineUnderTest.Any(Uint32Array); // eslint-disable-line compat/compat
|
||||
|
||||
expect(any.asymmetricMatch(new Uint32Array([]))).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(any.asymmetricMatch(new Uint32Array([]))).toBe(true);
|
||||
});
|
||||
|
||||
it('matches a Symbol', function() {
|
||||
|
||||
@@ -24,27 +24,21 @@ describe('Anything', function() {
|
||||
});
|
||||
|
||||
it('matches a Map', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
|
||||
var anything = new jasmineUnderTest.Anything();
|
||||
|
||||
expect(anything.asymmetricMatch(new Map())).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(anything.asymmetricMatch(new Map())).toBe(true);
|
||||
});
|
||||
|
||||
it('matches a Set', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var anything = new jasmineUnderTest.Anything();
|
||||
|
||||
expect(anything.asymmetricMatch(new Set())).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(anything.asymmetricMatch(new Set())).toBe(true);
|
||||
});
|
||||
|
||||
it('matches a TypedArray', function() {
|
||||
jasmine.getEnv().requireFunctioningTypedArrays();
|
||||
|
||||
var anything = new jasmineUnderTest.Anything();
|
||||
|
||||
expect(anything.asymmetricMatch(new Uint32Array([]))).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(anything.asymmetricMatch(new Uint32Array([]))).toBe(true);
|
||||
});
|
||||
|
||||
it('matches a Symbol', function() {
|
||||
|
||||
@@ -22,30 +22,27 @@ describe('Empty', function() {
|
||||
});
|
||||
|
||||
it('matches an empty map', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
var empty = new jasmineUnderTest.Empty();
|
||||
var fullMap = new Map(); // eslint-disable-line compat/compat
|
||||
var fullMap = new Map();
|
||||
fullMap.set('thing', 2);
|
||||
|
||||
expect(empty.asymmetricMatch(new Map())).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(empty.asymmetricMatch(new Map())).toBe(true);
|
||||
expect(empty.asymmetricMatch(fullMap)).toBe(false);
|
||||
});
|
||||
|
||||
it('matches an empty set', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
var empty = new jasmineUnderTest.Empty();
|
||||
var fullSet = new Set(); // eslint-disable-line compat/compat
|
||||
var fullSet = new Set();
|
||||
fullSet.add(3);
|
||||
|
||||
expect(empty.asymmetricMatch(new Set())).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(empty.asymmetricMatch(new Set())).toBe(true);
|
||||
expect(empty.asymmetricMatch(fullSet)).toBe(false);
|
||||
});
|
||||
|
||||
it('matches an empty typed array', function() {
|
||||
jasmine.getEnv().requireFunctioningTypedArrays();
|
||||
var empty = new jasmineUnderTest.Empty();
|
||||
|
||||
expect(empty.asymmetricMatch(new Int16Array())).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(empty.asymmetricMatch(new Int16Array([1, 2]))).toBe(false); // eslint-disable-line compat/compat
|
||||
expect(empty.asymmetricMatch(new Int16Array())).toBe(true);
|
||||
expect(empty.asymmetricMatch(new Int16Array([1, 2]))).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable compat/compat */
|
||||
describe('MapContaining', function() {
|
||||
function MapI(iterable) {
|
||||
// for IE11
|
||||
@@ -9,10 +8,6 @@ describe('MapContaining', function() {
|
||||
return map;
|
||||
}
|
||||
|
||||
beforeEach(function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
});
|
||||
|
||||
it('matches any actual map to an empty map', function() {
|
||||
var actualMap = new MapI([['foo', 'bar']]);
|
||||
var containing = new jasmineUnderTest.MapContaining(new Map());
|
||||
|
||||
@@ -22,32 +22,29 @@ describe('NotEmpty', function() {
|
||||
});
|
||||
|
||||
it('matches a non empty map', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
var notEmpty = new jasmineUnderTest.NotEmpty();
|
||||
var fullMap = new Map(); // eslint-disable-line compat/compat
|
||||
var fullMap = new Map();
|
||||
fullMap.set('one', 1);
|
||||
var emptyMap = new Map(); // eslint-disable-line compat/compat
|
||||
var emptyMap = new Map();
|
||||
|
||||
expect(notEmpty.asymmetricMatch(fullMap)).toBe(true);
|
||||
expect(notEmpty.asymmetricMatch(emptyMap)).toBe(false);
|
||||
});
|
||||
|
||||
it('matches a non empty set', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
var notEmpty = new jasmineUnderTest.NotEmpty();
|
||||
var filledSet = new Set(); // eslint-disable-line compat/compat
|
||||
var filledSet = new Set();
|
||||
filledSet.add(1);
|
||||
var emptySet = new Set(); // eslint-disable-line compat/compat
|
||||
var emptySet = new Set();
|
||||
|
||||
expect(notEmpty.asymmetricMatch(filledSet)).toBe(true);
|
||||
expect(notEmpty.asymmetricMatch(emptySet)).toBe(false);
|
||||
});
|
||||
|
||||
it('matches a non empty typed array', function() {
|
||||
jasmine.getEnv().requireFunctioningTypedArrays();
|
||||
var notEmpty = new jasmineUnderTest.NotEmpty();
|
||||
|
||||
expect(notEmpty.asymmetricMatch(new Int16Array([1, 2, 3]))).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(notEmpty.asymmetricMatch(new Int16Array())).toBe(false); // eslint-disable-line compat/compat
|
||||
expect(notEmpty.asymmetricMatch(new Int16Array([1, 2, 3]))).toBe(true);
|
||||
expect(notEmpty.asymmetricMatch(new Int16Array())).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable compat/compat */
|
||||
describe('SetContaining', function() {
|
||||
function SetI(iterable) {
|
||||
// for IE11
|
||||
@@ -9,10 +8,6 @@ describe('SetContaining', function() {
|
||||
return set;
|
||||
}
|
||||
|
||||
beforeEach(function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
});
|
||||
|
||||
it('matches any actual set to an empty set', function() {
|
||||
var actualSet = new SetI(['foo', 'bar']);
|
||||
var containing = new jasmineUnderTest.SetContaining(new Set());
|
||||
|
||||
@@ -54,8 +54,7 @@ describe('base helpers', function() {
|
||||
|
||||
describe('isSet', function() {
|
||||
it('returns true when the object is a Set', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
expect(jasmineUnderTest.isSet(new Set())).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(jasmineUnderTest.isSet(new Set())).toBe(true);
|
||||
});
|
||||
|
||||
it('returns false when the object is not a Set', function() {
|
||||
|
||||
@@ -122,40 +122,24 @@ describe('Asymmetric equality testers (Integration)', function() {
|
||||
});
|
||||
|
||||
describe('mapContaining', function() {
|
||||
if (jasmine.getEnv().hasFunctioningMaps()) {
|
||||
verifyPasses(function(env) {
|
||||
var actual = new Map();
|
||||
actual.set('a', '2');
|
||||
var expected = new Map();
|
||||
expected.set('a', 2);
|
||||
verifyPasses(function(env) {
|
||||
var actual = new Map();
|
||||
actual.set('a', '2');
|
||||
var expected = new Map();
|
||||
expected.set('a', 2);
|
||||
|
||||
env.addCustomEqualityTester(function(a, b) {
|
||||
return a.toString() === b.toString();
|
||||
});
|
||||
env.addCustomEqualityTester(function(a, b) {
|
||||
return a.toString() === b.toString();
|
||||
});
|
||||
|
||||
env.expect(actual).toEqual(jasmineUnderTest.mapContaining(expected));
|
||||
});
|
||||
} else {
|
||||
it('passes', function() {
|
||||
jasmine
|
||||
.getEnv()
|
||||
.pending('Browser has incomplete or missing support for Maps');
|
||||
});
|
||||
}
|
||||
env.expect(actual).toEqual(jasmineUnderTest.mapContaining(expected));
|
||||
});
|
||||
|
||||
if (jasmine.getEnv().hasFunctioningMaps()) {
|
||||
verifyFails(function(env) {
|
||||
env
|
||||
.expect('something')
|
||||
.toEqual(jasmineUnderTest.mapContaining(new Map()));
|
||||
});
|
||||
} else {
|
||||
it('fails', function() {
|
||||
jasmine
|
||||
.getEnv()
|
||||
.pending('Browser has incomplete or missing support for Maps');
|
||||
});
|
||||
}
|
||||
verifyFails(function(env) {
|
||||
env
|
||||
.expect('something')
|
||||
.toEqual(jasmineUnderTest.mapContaining(new Map()));
|
||||
});
|
||||
});
|
||||
|
||||
describe('notEmpty', function() {
|
||||
@@ -185,40 +169,24 @@ describe('Asymmetric equality testers (Integration)', function() {
|
||||
});
|
||||
|
||||
describe('setContaining', function() {
|
||||
if (jasmine.getEnv().hasFunctioningSets()) {
|
||||
verifyPasses(function(env) {
|
||||
var actual = new Set();
|
||||
actual.add('1');
|
||||
var expected = new Set();
|
||||
actual.add(1);
|
||||
verifyPasses(function(env) {
|
||||
var actual = new Set();
|
||||
actual.add('1');
|
||||
var expected = new Set();
|
||||
actual.add(1);
|
||||
|
||||
env.addCustomEqualityTester(function(a, b) {
|
||||
return a.toString() === b.toString();
|
||||
});
|
||||
env.addCustomEqualityTester(function(a, b) {
|
||||
return a.toString() === b.toString();
|
||||
});
|
||||
|
||||
env.expect(actual).toEqual(jasmineUnderTest.setContaining(expected));
|
||||
});
|
||||
} else {
|
||||
it('pases', function() {
|
||||
jasmine
|
||||
.getEnv()
|
||||
.pending('Browser has incomplete or missing support for Sets');
|
||||
});
|
||||
}
|
||||
env.expect(actual).toEqual(jasmineUnderTest.setContaining(expected));
|
||||
});
|
||||
|
||||
if (jasmine.getEnv().hasFunctioningSets()) {
|
||||
verifyFails(function(env) {
|
||||
env
|
||||
.expect('something')
|
||||
.toEqual(jasmineUnderTest.setContaining(new Set()));
|
||||
});
|
||||
} else {
|
||||
it('fails', function() {
|
||||
jasmine
|
||||
.getEnv()
|
||||
.pending('Browser has incomplete or missing support for Sets');
|
||||
});
|
||||
}
|
||||
verifyFails(function(env) {
|
||||
env
|
||||
.expect('something')
|
||||
.toEqual(jasmineUnderTest.setContaining(new Set()));
|
||||
});
|
||||
});
|
||||
|
||||
describe('stringMatching', function() {
|
||||
|
||||
@@ -439,13 +439,11 @@ describe('matchersUtil', function() {
|
||||
});
|
||||
|
||||
it('passes when MapContaining is used', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var obj = new Map(); // eslint-disable-line compat/compat
|
||||
var obj = new Map();
|
||||
obj.set(1, 2);
|
||||
obj.set('foo', 'bar');
|
||||
var containing = new jasmineUnderTest.MapContaining(new Map()); // eslint-disable-line compat/compat
|
||||
var containing = new jasmineUnderTest.MapContaining(new Map());
|
||||
containing.sample.set('foo', 'bar');
|
||||
|
||||
expect(matchersUtil.equals(obj, containing)).toBe(true);
|
||||
@@ -453,13 +451,11 @@ describe('matchersUtil', function() {
|
||||
});
|
||||
|
||||
it('passes when SetContaining is used', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var obj = new Set(); // eslint-disable-line compat/compat
|
||||
var obj = new Set();
|
||||
obj.add(1);
|
||||
obj.add('foo');
|
||||
var containing = new jasmineUnderTest.SetContaining(new Set()); // eslint-disable-line compat/compat
|
||||
var containing = new jasmineUnderTest.SetContaining(new Set());
|
||||
containing.sample.add(1);
|
||||
|
||||
expect(matchersUtil.equals(obj, containing)).toBe(true);
|
||||
@@ -591,19 +587,16 @@ describe('matchersUtil', function() {
|
||||
});
|
||||
|
||||
it('passes when comparing two empty sets', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
expect(matchersUtil.equals(new Set(), new Set())).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(matchersUtil.equals(new Set(), new Set())).toBe(true);
|
||||
});
|
||||
|
||||
it('passes when comparing identical sets', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var setA = new Set(); // eslint-disable-line compat/compat
|
||||
var setA = new Set();
|
||||
setA.add(6);
|
||||
setA.add(5);
|
||||
var setB = new Set(); // eslint-disable-line compat/compat
|
||||
var setB = new Set();
|
||||
setB.add(6);
|
||||
setB.add(5);
|
||||
|
||||
@@ -611,13 +604,11 @@ describe('matchersUtil', function() {
|
||||
});
|
||||
|
||||
it('passes when comparing identical sets with different insertion order and simple elements', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var setA = new Set(); // eslint-disable-line compat/compat
|
||||
var setA = new Set();
|
||||
setA.add(3);
|
||||
setA.add(6);
|
||||
var setB = new Set(); // eslint-disable-line compat/compat
|
||||
var setB = new Set();
|
||||
setB.add(6);
|
||||
setB.add(3);
|
||||
|
||||
@@ -625,26 +616,24 @@ describe('matchersUtil', function() {
|
||||
});
|
||||
|
||||
it('passes when comparing identical sets with different insertion order and complex elements 1', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var setA1 = new Set(); // eslint-disable-line compat/compat
|
||||
var setA1 = new Set();
|
||||
setA1.add(['a', 3]);
|
||||
setA1.add([6, 1]);
|
||||
var setA2 = new Set(); // eslint-disable-line compat/compat
|
||||
var setA2 = new Set();
|
||||
setA1.add(['y', 3]);
|
||||
setA1.add([6, 1]);
|
||||
var setA = new Set(); // eslint-disable-line compat/compat
|
||||
var setA = new Set();
|
||||
setA.add(setA1);
|
||||
setA.add(setA2);
|
||||
|
||||
var setB1 = new Set(); // eslint-disable-line compat/compat
|
||||
var setB1 = new Set();
|
||||
setB1.add([6, 1]);
|
||||
setB1.add(['a', 3]);
|
||||
var setB2 = new Set(); // eslint-disable-line compat/compat
|
||||
var setB2 = new Set();
|
||||
setB1.add([6, 1]);
|
||||
setB1.add(['y', 3]);
|
||||
var setB = new Set(); // eslint-disable-line compat/compat
|
||||
var setB = new Set();
|
||||
setB.add(setB1);
|
||||
setB.add(setB2);
|
||||
|
||||
@@ -652,13 +641,11 @@ describe('matchersUtil', function() {
|
||||
});
|
||||
|
||||
it('passes when comparing identical sets with different insertion order and complex elements 2', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var setA = new Set(); // eslint-disable-line compat/compat
|
||||
var setA = new Set();
|
||||
setA.add([[1, 2], [3, 4]]);
|
||||
setA.add([[5, 6], [7, 8]]);
|
||||
var setB = new Set(); // eslint-disable-line compat/compat
|
||||
var setB = new Set();
|
||||
setB.add([[5, 6], [7, 8]]);
|
||||
setB.add([[1, 2], [3, 4]]);
|
||||
|
||||
@@ -666,13 +653,12 @@ describe('matchersUtil', function() {
|
||||
});
|
||||
|
||||
it('fails for sets with different elements', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var setA = new Set(); // eslint-disable-line compat/compat
|
||||
var setA = new Set();
|
||||
setA.add(6);
|
||||
setA.add(3);
|
||||
setA.add(5);
|
||||
var setB = new Set(); // eslint-disable-line compat/compat
|
||||
var setB = new Set();
|
||||
setB.add(6);
|
||||
setB.add(4);
|
||||
setB.add(5);
|
||||
@@ -681,12 +667,11 @@ describe('matchersUtil', function() {
|
||||
});
|
||||
|
||||
it('fails for sets of different size', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var setA = new Set(); // eslint-disable-line compat/compat
|
||||
var setA = new Set();
|
||||
setA.add(6);
|
||||
setA.add(3);
|
||||
var setB = new Set(); // eslint-disable-line compat/compat
|
||||
var setB = new Set();
|
||||
setB.add(6);
|
||||
setB.add(4);
|
||||
setB.add(5);
|
||||
@@ -695,40 +680,36 @@ describe('matchersUtil', function() {
|
||||
});
|
||||
|
||||
it('passes when comparing two empty maps', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
expect(matchersUtil.equals(new Map(), new Map())).toBe(true); // eslint-disable-line compat/compat
|
||||
expect(matchersUtil.equals(new Map(), new Map())).toBe(true);
|
||||
});
|
||||
|
||||
it('passes when comparing identical maps', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var mapA = new Map(); // eslint-disable-line compat/compat
|
||||
var mapA = new Map();
|
||||
mapA.set(6, 5);
|
||||
var mapB = new Map(); // eslint-disable-line compat/compat
|
||||
var mapB = new Map();
|
||||
mapB.set(6, 5);
|
||||
expect(matchersUtil.equals(mapA, mapB)).toBe(true);
|
||||
});
|
||||
|
||||
it('passes when comparing identical maps with different insertion order', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var mapA = new Map(); // eslint-disable-line compat/compat
|
||||
var mapA = new Map();
|
||||
mapA.set('a', 3);
|
||||
mapA.set(6, 1);
|
||||
var mapB = new Map(); // eslint-disable-line compat/compat
|
||||
var mapB = new Map();
|
||||
mapB.set(6, 1);
|
||||
mapB.set('a', 3);
|
||||
expect(matchersUtil.equals(mapA, mapB)).toBe(true);
|
||||
});
|
||||
|
||||
it('fails for maps with different elements', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var mapA = new Map(); // eslint-disable-line compat/compat
|
||||
var mapA = new Map();
|
||||
mapA.set(6, 3);
|
||||
mapA.set(5, 1);
|
||||
var mapB = new Map(); // eslint-disable-line compat/compat
|
||||
var mapB = new Map();
|
||||
mapB.set(6, 4);
|
||||
mapB.set(5, 1);
|
||||
|
||||
@@ -736,11 +717,10 @@ describe('matchersUtil', function() {
|
||||
});
|
||||
|
||||
it('fails for maps of different size', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var mapA = new Map(); // eslint-disable-line compat/compat
|
||||
var mapA = new Map();
|
||||
mapA.set(6, 3);
|
||||
var mapB = new Map(); // eslint-disable-line compat/compat
|
||||
var mapB = new Map();
|
||||
mapB.set(6, 4);
|
||||
mapB.set(5, 1);
|
||||
expect(matchersUtil.equals(mapA, mapB)).toBe(false);
|
||||
@@ -795,19 +775,16 @@ describe('matchersUtil', function() {
|
||||
});
|
||||
|
||||
it('passes for ArrayBuffers with same length and content', function() {
|
||||
jasmine.getEnv().requireFunctioningArrayBuffers();
|
||||
var buffer1 = new ArrayBuffer(4); // eslint-disable-line compat/compat
|
||||
var buffer2 = new ArrayBuffer(4); // eslint-disable-line compat/compat
|
||||
var buffer1 = new ArrayBuffer(4);
|
||||
var buffer2 = new ArrayBuffer(4);
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
expect(matchersUtil.equals(buffer1, buffer2)).toBe(true);
|
||||
});
|
||||
|
||||
it('fails for ArrayBuffers with same length but different content', function() {
|
||||
jasmine.getEnv().requireFunctioningTypedArrays();
|
||||
jasmine.getEnv().requireFunctioningArrayBuffers();
|
||||
var buffer1 = new ArrayBuffer(4); // eslint-disable-line compat/compat
|
||||
var buffer2 = new ArrayBuffer(4); // eslint-disable-line compat/compat
|
||||
var array1 = new Uint8Array(buffer1); // eslint-disable-line compat/compat
|
||||
var buffer1 = new ArrayBuffer(4);
|
||||
var buffer2 = new ArrayBuffer(4);
|
||||
var array1 = new Uint8Array(buffer1);
|
||||
array1[0] = 1;
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
expect(matchersUtil.equals(buffer1, buffer2)).toBe(false);
|
||||
@@ -1019,11 +996,9 @@ describe('matchersUtil', function() {
|
||||
});
|
||||
|
||||
it('passes for set members', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var setItem = { foo: 'bar' };
|
||||
var set = new Set(); // eslint-disable-line compat/compat
|
||||
var set = new Set();
|
||||
set.add(setItem);
|
||||
|
||||
expect(matchersUtil.contains(set, setItem)).toBe(true);
|
||||
@@ -1031,10 +1006,8 @@ describe('matchersUtil', function() {
|
||||
|
||||
// documenting current behavior
|
||||
it('fails (!) for objects that equal to a set member', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
var set = new Set(); // eslint-disable-line compat/compat
|
||||
var set = new Set();
|
||||
set.add({ foo: 'bar' });
|
||||
|
||||
expect(matchersUtil.contains(set, { foo: 'bar' })).toBe(false);
|
||||
|
||||
@@ -257,10 +257,8 @@ describe('toEqual', function() {
|
||||
});
|
||||
|
||||
it('reports mismatches between arrays of different types', function() {
|
||||
jasmine.getEnv().requireFunctioningTypedArrays();
|
||||
|
||||
var actual = new Uint32Array([1, 2, 3]), // eslint-disable-line compat/compat
|
||||
expected = new Uint16Array([1, 2, 3]), // eslint-disable-line compat/compat
|
||||
var actual = new Uint32Array([1, 2, 3]),
|
||||
expected = new Uint16Array([1, 2, 3]),
|
||||
message =
|
||||
'Expected Uint32Array [ 1, 2, 3 ] to equal Uint16Array [ 1, 2, 3 ].';
|
||||
|
||||
@@ -462,11 +460,9 @@ describe('toEqual', function() {
|
||||
// == Sets ==
|
||||
|
||||
it('reports mismatches between Sets', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var actual = new Set(); // eslint-disable-line compat/compat
|
||||
var actual = new Set();
|
||||
actual.add(1);
|
||||
var expected = new Set(); // eslint-disable-line compat/compat
|
||||
var expected = new Set();
|
||||
expected.add(2);
|
||||
var message = 'Expected Set( 1 ) to equal Set( 2 ).';
|
||||
|
||||
@@ -474,11 +470,9 @@ describe('toEqual', function() {
|
||||
});
|
||||
|
||||
it('reports deep mismatches within Sets', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var actual = new Set(); // eslint-disable-line compat/compat
|
||||
var actual = new Set();
|
||||
actual.add({ x: 1 });
|
||||
var expected = new Set(); // eslint-disable-line compat/compat
|
||||
var expected = new Set();
|
||||
expected.add({ x: 2 });
|
||||
var message =
|
||||
'Expected Set( Object({ x: 1 }) ) to equal Set( Object({ x: 2 }) ).';
|
||||
@@ -487,11 +481,9 @@ describe('toEqual', function() {
|
||||
});
|
||||
|
||||
it('reports mismatches between Sets nested in objects', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var actualSet = new Set(); // eslint-disable-line compat/compat
|
||||
var actualSet = new Set();
|
||||
actualSet.add(1);
|
||||
var expectedSet = new Set(); // eslint-disable-line compat/compat
|
||||
var expectedSet = new Set();
|
||||
expectedSet.add(2);
|
||||
|
||||
var actual = { sets: [actualSet] };
|
||||
@@ -502,12 +494,10 @@ describe('toEqual', function() {
|
||||
});
|
||||
|
||||
it('reports mismatches between Sets of different lengths', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var actual = new Set(); // eslint-disable-line compat/compat
|
||||
var actual = new Set();
|
||||
actual.add(1);
|
||||
actual.add(2);
|
||||
var expected = new Set(); // eslint-disable-line compat/compat
|
||||
var expected = new Set();
|
||||
expected.add(2);
|
||||
var message = 'Expected Set( 1, 2 ) to equal Set( 2 ).';
|
||||
|
||||
@@ -515,13 +505,11 @@ describe('toEqual', function() {
|
||||
});
|
||||
|
||||
it('reports mismatches between Sets where actual is missing a value from expected', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
// Use 'duplicate' object in actual so sizes match
|
||||
var actual = new Set(); // eslint-disable-line compat/compat
|
||||
var actual = new Set();
|
||||
actual.add({ x: 1 });
|
||||
actual.add({ x: 1 });
|
||||
var expected = new Set(); // eslint-disable-line compat/compat
|
||||
var expected = new Set();
|
||||
expected.add({ x: 1 });
|
||||
expected.add({ x: 2 });
|
||||
var message =
|
||||
@@ -531,13 +519,11 @@ describe('toEqual', function() {
|
||||
});
|
||||
|
||||
it('reports mismatches between Sets where actual has a value missing from expected', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
// Use 'duplicate' object in expected so sizes match
|
||||
var actual = new Set(); // eslint-disable-line compat/compat
|
||||
var actual = new Set();
|
||||
actual.add({ x: 1 });
|
||||
actual.add({ x: 2 });
|
||||
var expected = new Set(); // eslint-disable-line compat/compat
|
||||
var expected = new Set();
|
||||
expected.add({ x: 1 });
|
||||
expected.add({ x: 1 });
|
||||
var message =
|
||||
@@ -549,23 +535,19 @@ describe('toEqual', function() {
|
||||
// == Maps ==
|
||||
|
||||
it('does not report mismatches between deep equal Maps', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
|
||||
// values are the same but with different object identity
|
||||
var actual = new Map(); // eslint-disable-line compat/compat
|
||||
var actual = new Map();
|
||||
actual.set('a', { x: 1 });
|
||||
var expected = new Map(); // eslint-disable-line compat/compat
|
||||
var expected = new Map();
|
||||
expected.set('a', { x: 1 });
|
||||
|
||||
expect(compareEquals(actual, expected).pass).toBe(true);
|
||||
});
|
||||
|
||||
it('reports deep mismatches within Maps', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
|
||||
var actual = new Map(); // eslint-disable-line compat/compat
|
||||
var actual = new Map();
|
||||
actual.set('a', { x: 1 });
|
||||
var expected = new Map(); // eslint-disable-line compat/compat
|
||||
var expected = new Map();
|
||||
expected.set('a', { x: 2 });
|
||||
var message =
|
||||
"Expected Map( [ 'a', Object({ x: 1 }) ] ) to equal Map( [ 'a', Object({ x: 2 }) ] ).";
|
||||
@@ -574,11 +556,9 @@ describe('toEqual', function() {
|
||||
});
|
||||
|
||||
it('reports mismatches between Maps nested in objects', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
|
||||
var actual = { Maps: [new Map()] }; // eslint-disable-line compat/compat
|
||||
var actual = { Maps: [new Map()] };
|
||||
actual.Maps[0].set('a', 1);
|
||||
var expected = { Maps: [new Map()] }; // eslint-disable-line compat/compat
|
||||
var expected = { Maps: [new Map()] };
|
||||
expected.Maps[0].set('a', 2);
|
||||
|
||||
var message =
|
||||
@@ -588,11 +568,9 @@ describe('toEqual', function() {
|
||||
});
|
||||
|
||||
it('reports mismatches between Maps of different lengths', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
|
||||
var actual = new Map(); // eslint-disable-line compat/compat
|
||||
var actual = new Map();
|
||||
actual.set('a', 1);
|
||||
var expected = new Map(); // eslint-disable-line compat/compat
|
||||
var expected = new Map();
|
||||
expected.set('a', 2);
|
||||
expected.set('b', 1);
|
||||
var message =
|
||||
@@ -602,11 +580,9 @@ describe('toEqual', function() {
|
||||
});
|
||||
|
||||
it('reports mismatches between Maps with equal values but differing keys', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
|
||||
var actual = new Map(); // eslint-disable-line compat/compat
|
||||
var actual = new Map();
|
||||
actual.set('a', 1);
|
||||
var expected = new Map(); // eslint-disable-line compat/compat
|
||||
var expected = new Map();
|
||||
expected.set('b', 1);
|
||||
var message = "Expected Map( [ 'a', 1 ] ) to equal Map( [ 'b', 1 ] ).";
|
||||
|
||||
@@ -614,22 +590,19 @@ describe('toEqual', function() {
|
||||
});
|
||||
|
||||
it('does not report mismatches between Maps with keys with same object identity', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
var key = { x: 1 };
|
||||
var actual = new Map(); // eslint-disable-line compat/compat
|
||||
var actual = new Map();
|
||||
actual.set(key, 2);
|
||||
var expected = new Map(); // eslint-disable-line compat/compat
|
||||
var expected = new Map();
|
||||
expected.set(key, 2);
|
||||
|
||||
expect(compareEquals(actual, expected).pass).toBe(true);
|
||||
});
|
||||
|
||||
it('reports mismatches between Maps with identical keys with different object identity', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
|
||||
var actual = new Map(); // eslint-disable-line compat/compat
|
||||
var actual = new Map();
|
||||
actual.set({ x: 1 }, 2);
|
||||
var expected = new Map(); // eslint-disable-line compat/compat
|
||||
var expected = new Map();
|
||||
expected.set({ x: 1 }, 2);
|
||||
var message =
|
||||
'Expected Map( [ Object({ x: 1 }), 2 ] ) to equal Map( [ Object({ x: 1 }), 2 ] ).';
|
||||
@@ -638,36 +611,32 @@ describe('toEqual', function() {
|
||||
});
|
||||
|
||||
it('does not report mismatches when comparing Map key to jasmine.anything()', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
|
||||
var actual = new Map(); // eslint-disable-line compat/compat
|
||||
var actual = new Map();
|
||||
actual.set('a', 1);
|
||||
var expected = new Map(); // eslint-disable-line compat/compat
|
||||
var expected = new Map();
|
||||
expected.set(jasmineUnderTest.anything(), 1);
|
||||
|
||||
expect(compareEquals(actual, expected).pass).toBe(true);
|
||||
});
|
||||
|
||||
it('does not report mismatches when comparing Maps with the same symbol keys', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
jasmine.getEnv().requireFunctioningSymbols();
|
||||
|
||||
var key = Symbol(); // eslint-disable-line compat/compat
|
||||
var actual = new Map(); // eslint-disable-line compat/compat
|
||||
var actual = new Map();
|
||||
actual.set(key, 1);
|
||||
var expected = new Map(); // eslint-disable-line compat/compat
|
||||
var expected = new Map();
|
||||
expected.set(key, 1);
|
||||
|
||||
expect(compareEquals(actual, expected).pass).toBe(true);
|
||||
});
|
||||
|
||||
it('reports mismatches between Maps with different symbol keys', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
jasmine.getEnv().requireFunctioningSymbols();
|
||||
|
||||
var actual = new Map(); // eslint-disable-line compat/compat
|
||||
var actual = new Map();
|
||||
actual.set(Symbol(), 1); // eslint-disable-line compat/compat
|
||||
var expected = new Map(); // eslint-disable-line compat/compat
|
||||
var expected = new Map();
|
||||
expected.set(Symbol(), 1); // eslint-disable-line compat/compat
|
||||
var message =
|
||||
'Expected Map( [ Symbol(), 1 ] ) to equal Map( [ Symbol(), 1 ] ).';
|
||||
@@ -676,12 +645,11 @@ describe('toEqual', function() {
|
||||
});
|
||||
|
||||
it('does not report mismatches when comparing Map symbol key to jasmine.anything()', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
jasmine.getEnv().requireFunctioningSymbols();
|
||||
|
||||
var actual = new Map(); // eslint-disable-line compat/compat
|
||||
var actual = new Map();
|
||||
actual.set(Symbol(), 1); // eslint-disable-line compat/compat
|
||||
var expected = new Map(); // eslint-disable-line compat/compat
|
||||
var expected = new Map();
|
||||
expected.set(jasmineUnderTest.anything(), 1);
|
||||
|
||||
expect(compareEquals(actual, expected).pass).toBe(true);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable compat/compat */
|
||||
describe('toHaveSize', function() {
|
||||
'use strict';
|
||||
|
||||
@@ -59,8 +58,6 @@ describe('toHaveSize', function() {
|
||||
});
|
||||
|
||||
it('passes for a Map whose length matches', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
|
||||
var map = new Map();
|
||||
map.set('a', 1);
|
||||
map.set('b', 2);
|
||||
@@ -72,8 +69,6 @@ describe('toHaveSize', function() {
|
||||
});
|
||||
|
||||
it('fails for a Map whose length does not match', function() {
|
||||
jasmine.getEnv().requireFunctioningMaps();
|
||||
|
||||
var map = new Map();
|
||||
map.set('a', 1);
|
||||
map.set('b', 2);
|
||||
@@ -85,8 +80,6 @@ describe('toHaveSize', function() {
|
||||
});
|
||||
|
||||
it('passes for a Set whose length matches', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var set = new Set();
|
||||
set.add('a');
|
||||
set.add('b');
|
||||
@@ -98,8 +91,6 @@ describe('toHaveSize', function() {
|
||||
});
|
||||
|
||||
it('fails for a Set whose length does not match', function() {
|
||||
jasmine.getEnv().requireFunctioningSets();
|
||||
|
||||
var set = new Set();
|
||||
set.add('a');
|
||||
set.add('b');
|
||||
@@ -115,7 +106,7 @@ describe('toHaveSize', function() {
|
||||
var matcher = jasmineUnderTest.matchers.toHaveSize();
|
||||
|
||||
expect(function() {
|
||||
matcher.compare(new WeakSet(), 2);
|
||||
matcher.compare(new WeakSet(), 2); // eslint-disable-line compat/compat
|
||||
}).toThrowError('Cannot get size of [object WeakSet].');
|
||||
});
|
||||
|
||||
|
||||
@@ -92,16 +92,9 @@ describe('toThrowError', function() {
|
||||
iframe.src = 'about:blank';
|
||||
var iframeDocument = iframe.contentWindow.document;
|
||||
|
||||
if (iframeDocument.body) {
|
||||
iframeDocument.body.appendChild(
|
||||
iframeDocument.createElement('script')
|
||||
).textContent = "function method() { throw new Error('foo'); }";
|
||||
} else {
|
||||
// IE 10 and older
|
||||
iframeDocument.write(
|
||||
"<html><head><script>function method() { throw new Error('foo'); }</script></head></html>"
|
||||
);
|
||||
}
|
||||
iframeDocument.body.appendChild(
|
||||
iframeDocument.createElement('script')
|
||||
).textContent = "function method() { throw new Error('foo'); }";
|
||||
|
||||
var result = matcher.compare(iframe.contentWindow.method);
|
||||
expect(result.pass).toBe(true);
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/* eslint-disable compat/compat */
|
||||
(function(env) {
|
||||
function hasFunctioningArrayBuffers() {
|
||||
if (typeof ArrayBuffer === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
var buffer = new ArrayBuffer(2);
|
||||
var view8bit = new Uint8Array(buffer);
|
||||
var view16bit = new Uint16Array(buffer);
|
||||
view16bit[0] = 0xabcd;
|
||||
return view8bit[0] === 0xcd && view8bit[1] === 0xab;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
env.requireFunctioningArrayBuffers = function() {
|
||||
env.requireFunctioningTypedArrays();
|
||||
if (!hasFunctioningArrayBuffers()) {
|
||||
env.pending('Browser has incomplete or missing support for ArrayBuffer');
|
||||
}
|
||||
};
|
||||
})(jasmine.getEnv());
|
||||
@@ -1,50 +1,5 @@
|
||||
/* eslint-disable compat/compat */
|
||||
(function(env) {
|
||||
env.hasFunctioningMaps = function() {
|
||||
if (typeof Map === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
var s = new Map();
|
||||
s.set('a', 1);
|
||||
s.set('b', 2);
|
||||
|
||||
if (s.size !== 2) {
|
||||
return false;
|
||||
}
|
||||
if (s.has('a') !== true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var iterations = 0;
|
||||
var ifForEachWorking = true;
|
||||
s.forEach(function(value, key, map) {
|
||||
ifForEachWorking = ifForEachWorking && map === s;
|
||||
if (key === 'a') {
|
||||
ifForEachWorking = ifForEachWorking && value === 1;
|
||||
}
|
||||
iterations++;
|
||||
});
|
||||
if (iterations !== 2) {
|
||||
return false;
|
||||
}
|
||||
if (ifForEachWorking !== true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
env.requireFunctioningMaps = function() {
|
||||
if (!env.hasFunctioningMaps()) {
|
||||
env.pending('Browser has incomplete or missing support for Maps');
|
||||
}
|
||||
};
|
||||
|
||||
env.requireWeakMaps = function() {
|
||||
if (typeof WeakMap === 'undefined') {
|
||||
env.pending('Browser does not have support for WeakMap');
|
||||
|
||||
@@ -1,54 +1,5 @@
|
||||
/* eslint-disable compat/compat */
|
||||
(function(env) {
|
||||
env.hasFunctioningSets = function() {
|
||||
if (typeof Set === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
var s = new Set();
|
||||
s.add(1);
|
||||
s.add(2);
|
||||
|
||||
if (s.size !== 2) {
|
||||
return false;
|
||||
}
|
||||
if (s.has(1) !== true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var iterations = 0;
|
||||
var isForEachWorking = true;
|
||||
s.forEach(function(value, key, set) {
|
||||
isForEachWorking = isForEachWorking && set === s;
|
||||
|
||||
if (iterations === 0) {
|
||||
isForEachWorking = isForEachWorking && key === value && value === 1;
|
||||
} else if (iterations === 1) {
|
||||
isForEachWorking = isForEachWorking && key === value && value === 2;
|
||||
}
|
||||
|
||||
iterations++;
|
||||
});
|
||||
if (iterations !== 2) {
|
||||
return false;
|
||||
}
|
||||
if (isForEachWorking !== true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
env.requireFunctioningSets = function() {
|
||||
if (!env.hasFunctioningSets()) {
|
||||
env.pending('Browser has incomplete or missing support for Sets');
|
||||
}
|
||||
};
|
||||
|
||||
env.requireWeakSets = function() {
|
||||
if (typeof WeakSet === 'undefined') {
|
||||
env.pending('Browser does not have support for WeakSet');
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
/* eslint-disable compat/compat */
|
||||
(function(env) {
|
||||
function hasFunctioningTypedArrays() {
|
||||
if (typeof Uint32Array === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
var a = new Uint32Array([1, 2, 3]);
|
||||
if (a.length !== 3) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
env.requireFunctioningTypedArrays = function() {
|
||||
if (!hasFunctioningTypedArrays()) {
|
||||
env.pending('Browser has incomplete or missing support for typed arrays');
|
||||
}
|
||||
};
|
||||
})(jasmine.getEnv());
|
||||
@@ -20,11 +20,9 @@ module.exports = {
|
||||
'helpers/asyncAwait.js',
|
||||
'helpers/generator.js',
|
||||
'helpers/BrowserFlags.js',
|
||||
'helpers/checkForArrayBuffer.js',
|
||||
'helpers/checkForMap.js',
|
||||
'helpers/checkForSet.js',
|
||||
'helpers/checkForSymbol.js',
|
||||
'helpers/checkForTypedArrays.js',
|
||||
'helpers/checkForUrl.js',
|
||||
'helpers/domHelpers.js',
|
||||
'helpers/integrationMatchers.js',
|
||||
|
||||
@@ -7,11 +7,9 @@
|
||||
"helpers": [
|
||||
"helpers/asyncAwait.js",
|
||||
"helpers/generator.js",
|
||||
"helpers/checkForArrayBuffer.js",
|
||||
"helpers/checkForMap.js",
|
||||
"helpers/checkForSet.js",
|
||||
"helpers/checkForSymbol.js",
|
||||
"helpers/checkForTypedArrays.js",
|
||||
"helpers/checkForUrl.js",
|
||||
"helpers/domHelpers.js",
|
||||
"helpers/integrationMatchers.js",
|
||||
|
||||
@@ -138,7 +138,6 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
||||
return (
|
||||
obj !== null &&
|
||||
typeof obj !== 'undefined' &&
|
||||
typeof jasmineGlobal.Map !== 'undefined' &&
|
||||
obj.constructor === jasmineGlobal.Map
|
||||
);
|
||||
};
|
||||
@@ -147,7 +146,6 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
||||
return (
|
||||
obj !== null &&
|
||||
typeof obj !== 'undefined' &&
|
||||
typeof jasmineGlobal.Set !== 'undefined' &&
|
||||
obj.constructor === jasmineGlobal.Set
|
||||
);
|
||||
};
|
||||
|
||||
@@ -234,8 +234,8 @@ getJasmineRequireObj().MatchersUtil = function(j$) {
|
||||
// If we have an instance of ArrayBuffer the Uint8Array ctor
|
||||
// will be defined as well
|
||||
return self.eq_(
|
||||
new Uint8Array(a), // eslint-disable-line compat/compat
|
||||
new Uint8Array(b), // eslint-disable-line compat/compat
|
||||
new Uint8Array(a),
|
||||
new Uint8Array(b),
|
||||
aStack,
|
||||
bStack,
|
||||
diffBuilder
|
||||
|
||||
Reference in New Issue
Block a user