Check for syntax and standard library objects that don't work in IE
This commit is contained in:
+16
-1
@@ -29,6 +29,7 @@
|
|||||||
"acorn": "^6.0.0",
|
"acorn": "^6.0.0",
|
||||||
"ejs": "^2.5.5",
|
"ejs": "^2.5.5",
|
||||||
"eslint": "7.3.1",
|
"eslint": "7.3.1",
|
||||||
|
"eslint-plugin-compat": "^3.8.0",
|
||||||
"express": "^4.16.4",
|
"express": "^4.16.4",
|
||||||
"fast-check": "^1.21.0",
|
"fast-check": "^1.21.0",
|
||||||
"fast-glob": "^2.2.6",
|
"fast-glob": "^2.2.6",
|
||||||
@@ -52,6 +53,12 @@
|
|||||||
"singleQuote": true
|
"singleQuote": true
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
|
"extends": [
|
||||||
|
"plugin:compat/recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 5
|
||||||
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"quotes": [
|
"quotes": [
|
||||||
"error",
|
"error",
|
||||||
@@ -81,5 +88,13 @@
|
|||||||
],
|
],
|
||||||
"space-before-blocks": "error"
|
"space-before-blocks": "error"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"Safari >= 8",
|
||||||
|
"last 2 Chrome versions",
|
||||||
|
"last 2 Firefox versions",
|
||||||
|
"Firefox 68",
|
||||||
|
"last 2 Edge versions",
|
||||||
|
"IE >= 10"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
|
"ignorePatterns": [
|
||||||
|
"support/ci.js",
|
||||||
|
"support/jasmine-browser.js"
|
||||||
|
],
|
||||||
rules: {
|
rules: {
|
||||||
// Relax rules for now to allow for the quirks of the test suite
|
// Relax rules for now to allow for the quirks of the test suite
|
||||||
// TODO: We should probably remove these & fix the resulting errors
|
// TODO: We should probably remove these & fix the resulting errors
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
describe('AsyncExpectation', function() {
|
describe('AsyncExpectation', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
jasmineUnderTest.Expectation.addAsyncCoreMatchers(
|
jasmineUnderTest.Expectation.addAsyncCoreMatchers(
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ describe('PrettyPrinter', function() {
|
|||||||
describe('stringify sets', function() {
|
describe('stringify sets', function() {
|
||||||
it('should stringify sets properly', function() {
|
it('should stringify sets properly', function() {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
var set = new Set();
|
var set = new Set(); // eslint-disable-line compat/compat
|
||||||
set.add(1);
|
set.add(1);
|
||||||
set.add(2);
|
set.add(2);
|
||||||
var pp = jasmineUnderTest.makePrettyPrinter();
|
var pp = jasmineUnderTest.makePrettyPrinter();
|
||||||
@@ -32,7 +32,7 @@ describe('PrettyPrinter', function() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH = 2;
|
jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH = 2;
|
||||||
var set = new Set();
|
var set = new Set(); // eslint-disable-line compat/compat
|
||||||
set.add('a');
|
set.add('a');
|
||||||
set.add('b');
|
set.add('b');
|
||||||
set.add('c');
|
set.add('c');
|
||||||
@@ -47,7 +47,7 @@ describe('PrettyPrinter', function() {
|
|||||||
describe('stringify maps', function() {
|
describe('stringify maps', function() {
|
||||||
it('should stringify maps properly', function() {
|
it('should stringify maps properly', function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
var map = new Map();
|
var map = new Map(); // eslint-disable-line compat/compat
|
||||||
map.set(1, 2);
|
map.set(1, 2);
|
||||||
var pp = jasmineUnderTest.makePrettyPrinter();
|
var pp = jasmineUnderTest.makePrettyPrinter();
|
||||||
expect(pp(map)).toEqual('Map( [ 1, 2 ] )');
|
expect(pp(map)).toEqual('Map( [ 1, 2 ] )');
|
||||||
@@ -59,7 +59,7 @@ describe('PrettyPrinter', function() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH = 2;
|
jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH = 2;
|
||||||
var map = new Map();
|
var map = new Map(); // eslint-disable-line compat/compat
|
||||||
map.set('a', 1);
|
map.set('a', 1);
|
||||||
map.set('b', 2);
|
map.set('b', 2);
|
||||||
map.set('c', 3);
|
map.set('c', 3);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ describe('jasmineUnderTest.util', function() {
|
|||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
jasmine.getEnv().requirePromises();
|
jasmine.getEnv().requirePromises();
|
||||||
mockNativePromise = new Promise(function(res, rej) {});
|
mockNativePromise = new Promise(function(res, rej) {}); // eslint-disable-line compat/compat
|
||||||
mockPromiseLikeObject = new mockPromiseLike();
|
mockPromiseLikeObject = new mockPromiseLike();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ describe("Any", function() {
|
|||||||
|
|
||||||
var any = new jasmineUnderTest.Any(Map);
|
var any = new jasmineUnderTest.Any(Map);
|
||||||
|
|
||||||
expect(any.asymmetricMatch(new Map())).toBe(true);
|
expect(any.asymmetricMatch(new Map())).toBe(true); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches a Set", function() {
|
it("matches a Set", function() {
|
||||||
@@ -42,23 +42,23 @@ describe("Any", function() {
|
|||||||
|
|
||||||
var any = new jasmineUnderTest.Any(Set);
|
var any = new jasmineUnderTest.Any(Set);
|
||||||
|
|
||||||
expect(any.asymmetricMatch(new Set())).toBe(true);
|
expect(any.asymmetricMatch(new Set())).toBe(true); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches a TypedArray", function() {
|
it("matches a TypedArray", function() {
|
||||||
jasmine.getEnv().requireFunctioningTypedArrays();
|
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);
|
expect(any.asymmetricMatch(new Uint32Array([]))).toBe(true); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches a Symbol", function() {
|
it("matches a Symbol", function() {
|
||||||
jasmine.getEnv().requireFunctioningSymbols();
|
jasmine.getEnv().requireFunctioningSymbols();
|
||||||
|
|
||||||
var any = new jasmineUnderTest.Any(Symbol);
|
var any = new jasmineUnderTest.Any(Symbol); // eslint-disable-line compat/compat
|
||||||
|
|
||||||
expect(any.asymmetricMatch(Symbol())).toBe(true);
|
expect(any.asymmetricMatch(Symbol())).toBe(true); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches another constructed object", function() {
|
it("matches another constructed object", function() {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ describe("Anything", function() {
|
|||||||
|
|
||||||
var anything = new jasmineUnderTest.Anything();
|
var anything = new jasmineUnderTest.Anything();
|
||||||
|
|
||||||
expect(anything.asymmetricMatch(new Map())).toBe(true);
|
expect(anything.asymmetricMatch(new Map())).toBe(true); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches a Set", function() {
|
it("matches a Set", function() {
|
||||||
@@ -36,7 +36,7 @@ describe("Anything", function() {
|
|||||||
|
|
||||||
var anything = new jasmineUnderTest.Anything();
|
var anything = new jasmineUnderTest.Anything();
|
||||||
|
|
||||||
expect(anything.asymmetricMatch(new Set())).toBe(true);
|
expect(anything.asymmetricMatch(new Set())).toBe(true); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches a TypedArray", function() {
|
it("matches a TypedArray", function() {
|
||||||
@@ -44,7 +44,7 @@ describe("Anything", function() {
|
|||||||
|
|
||||||
var anything = new jasmineUnderTest.Anything();
|
var anything = new jasmineUnderTest.Anything();
|
||||||
|
|
||||||
expect(anything.asymmetricMatch(new Uint32Array([]))).toBe(true);
|
expect(anything.asymmetricMatch(new Uint32Array([]))).toBe(true); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches a Symbol", function() {
|
it("matches a Symbol", function() {
|
||||||
@@ -52,7 +52,7 @@ describe("Anything", function() {
|
|||||||
|
|
||||||
var anything = new jasmineUnderTest.Anything();
|
var anything = new jasmineUnderTest.Anything();
|
||||||
|
|
||||||
expect(anything.asymmetricMatch(Symbol())).toBe(true);
|
expect(anything.asymmetricMatch(Symbol())).toBe(true); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
it("doesn't match undefined", function() {
|
it("doesn't match undefined", function() {
|
||||||
|
|||||||
@@ -24,20 +24,20 @@ describe("Empty", function () {
|
|||||||
it("matches an empty map", function () {
|
it("matches an empty map", function () {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
var empty = new jasmineUnderTest.Empty();
|
var empty = new jasmineUnderTest.Empty();
|
||||||
var fullMap = new Map();
|
var fullMap = new Map(); // eslint-disable-line compat/compat
|
||||||
fullMap.set('thing', 2);
|
fullMap.set('thing', 2);
|
||||||
|
|
||||||
expect(empty.asymmetricMatch(new Map())).toBe(true);
|
expect(empty.asymmetricMatch(new Map())).toBe(true); // eslint-disable-line compat/compat
|
||||||
expect(empty.asymmetricMatch(fullMap)).toBe(false);
|
expect(empty.asymmetricMatch(fullMap)).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("matches an empty set", function () {
|
it("matches an empty set", function () {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
var empty = new jasmineUnderTest.Empty();
|
var empty = new jasmineUnderTest.Empty();
|
||||||
var fullSet = new Set();
|
var fullSet = new Set(); // eslint-disable-line compat/compat
|
||||||
fullSet.add(3);
|
fullSet.add(3);
|
||||||
|
|
||||||
expect(empty.asymmetricMatch(new Set())).toBe(true);
|
expect(empty.asymmetricMatch(new Set())).toBe(true); // eslint-disable-line compat/compat
|
||||||
expect(empty.asymmetricMatch(fullSet)).toBe(false);
|
expect(empty.asymmetricMatch(fullSet)).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ describe("Empty", function () {
|
|||||||
jasmine.getEnv().requireFunctioningTypedArrays();
|
jasmine.getEnv().requireFunctioningTypedArrays();
|
||||||
var empty = new jasmineUnderTest.Empty();
|
var empty = new jasmineUnderTest.Empty();
|
||||||
|
|
||||||
expect(empty.asymmetricMatch(new Int16Array())).toBe(true);
|
expect(empty.asymmetricMatch(new Int16Array())).toBe(true); // eslint-disable-line compat/compat
|
||||||
expect(empty.asymmetricMatch(new Int16Array([1,2]))).toBe(false);
|
expect(empty.asymmetricMatch(new Int16Array([1,2]))).toBe(false); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
describe('MapContaining', function() {
|
describe('MapContaining', function() {
|
||||||
function MapI(iterable) { // for IE11
|
function MapI(iterable) { // for IE11
|
||||||
var map = new Map();
|
var map = new Map();
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ describe("NotEmpty", function () {
|
|||||||
it("matches a non empty map", function () {
|
it("matches a non empty map", function () {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
var notEmpty = new jasmineUnderTest.NotEmpty();
|
var notEmpty = new jasmineUnderTest.NotEmpty();
|
||||||
var fullMap = new Map();
|
var fullMap = new Map(); // eslint-disable-line compat/compat
|
||||||
fullMap.set('one', 1);
|
fullMap.set('one', 1);
|
||||||
var emptyMap = new Map();
|
var emptyMap = new Map(); // eslint-disable-line compat/compat
|
||||||
|
|
||||||
expect(notEmpty.asymmetricMatch(fullMap)).toBe(true);
|
expect(notEmpty.asymmetricMatch(fullMap)).toBe(true);
|
||||||
expect(notEmpty.asymmetricMatch(emptyMap)).toBe(false);
|
expect(notEmpty.asymmetricMatch(emptyMap)).toBe(false);
|
||||||
@@ -35,9 +35,9 @@ describe("NotEmpty", function () {
|
|||||||
it("matches a non empty set", function () {
|
it("matches a non empty set", function () {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
var notEmpty = new jasmineUnderTest.NotEmpty();
|
var notEmpty = new jasmineUnderTest.NotEmpty();
|
||||||
var filledSet = new Set();
|
var filledSet = new Set(); // eslint-disable-line compat/compat
|
||||||
filledSet.add(1);
|
filledSet.add(1);
|
||||||
var emptySet = new Set();
|
var emptySet = new Set(); // eslint-disable-line compat/compat
|
||||||
|
|
||||||
expect(notEmpty.asymmetricMatch(filledSet)).toBe(true);
|
expect(notEmpty.asymmetricMatch(filledSet)).toBe(true);
|
||||||
expect(notEmpty.asymmetricMatch(emptySet)).toBe(false);
|
expect(notEmpty.asymmetricMatch(emptySet)).toBe(false);
|
||||||
@@ -47,7 +47,7 @@ describe("NotEmpty", function () {
|
|||||||
jasmine.getEnv().requireFunctioningTypedArrays();
|
jasmine.getEnv().requireFunctioningTypedArrays();
|
||||||
var notEmpty = new jasmineUnderTest.NotEmpty();
|
var notEmpty = new jasmineUnderTest.NotEmpty();
|
||||||
|
|
||||||
expect(notEmpty.asymmetricMatch(new Int16Array([1,2,3]))).toBe(true);
|
expect(notEmpty.asymmetricMatch(new Int16Array([1,2,3]))).toBe(true); // eslint-disable-line compat/compat
|
||||||
expect(notEmpty.asymmetricMatch(new Int16Array())).toBe(false);
|
expect(notEmpty.asymmetricMatch(new Int16Array())).toBe(false); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
describe('SetContaining', function() {
|
describe('SetContaining', function() {
|
||||||
function SetI(iterable) { // for IE11
|
function SetI(iterable) { // for IE11
|
||||||
var set = new Set();
|
var set = new Set();
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ describe('base helpers', function() {
|
|||||||
describe('isSet', function() {
|
describe('isSet', function() {
|
||||||
it('returns true when the object is a Set', function() {
|
it('returns true when the object is a Set', function() {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
expect(jasmineUnderTest.isSet(new Set())).toBe(true);
|
expect(jasmineUnderTest.isSet(new Set())).toBe(true); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false when the object is not a Set', function() {
|
it('returns false when the object is not a Set', function() {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
describe('Custom Async Matchers (Integration)', function() {
|
describe('Custom Async Matchers (Integration)', function() {
|
||||||
var env;
|
var env;
|
||||||
|
|
||||||
|
|||||||
@@ -2581,7 +2581,7 @@ describe("Env integration", function() {
|
|||||||
|
|
||||||
function fail(innerDone) {
|
function fail(innerDone) {
|
||||||
var resolve;
|
var resolve;
|
||||||
var p = new Promise(function(res, rej) { resolve = res });
|
var p = new Promise(function(res, rej) { resolve = res }); // eslint-disable-line compat/compat
|
||||||
env.expectAsync(p).toBeRejected().then(innerDone);
|
env.expectAsync(p).toBeRejected().then(innerDone);
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
@@ -2613,7 +2613,7 @@ describe("Env integration", function() {
|
|||||||
|
|
||||||
env.it('has an async failure', function() {
|
env.it('has an async failure', function() {
|
||||||
env.addCustomEqualityTester(function() { return true; });
|
env.addCustomEqualityTester(function() { return true; });
|
||||||
var p = Promise.resolve('something');
|
var p = Promise.resolve('something'); // eslint-disable-line compat/compat
|
||||||
return env.expectAsync(p).toBeResolvedTo('something else');
|
return env.expectAsync(p).toBeResolvedTo('something else');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2639,7 +2639,7 @@ describe("Env integration", function() {
|
|||||||
|
|
||||||
env.it('has an async failure', function() {
|
env.it('has an async failure', function() {
|
||||||
env.addCustomEqualityTester(function() { return true; });
|
env.addCustomEqualityTester(function() { return true; });
|
||||||
var p = Promise.resolve();
|
var p = Promise.resolve(); // eslint-disable-line compat/compat
|
||||||
return env.expectAsync(p).toBeRejected();
|
return env.expectAsync(p).toBeRejected();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2650,7 +2650,7 @@ describe("Env integration", function() {
|
|||||||
jasmine.getEnv().requirePromises();
|
jasmine.getEnv().requirePromises();
|
||||||
|
|
||||||
var resolve,
|
var resolve,
|
||||||
promise = new Promise(function(res) { resolve = res; });
|
promise = new Promise(function(res) { resolve = res; }); // eslint-disable-line compat/compat
|
||||||
|
|
||||||
env.describe('a suite', function() {
|
env.describe('a suite', function() {
|
||||||
env.it('does not wait', function() {
|
env.it('does not wait', function() {
|
||||||
@@ -2698,7 +2698,7 @@ describe("Env integration", function() {
|
|||||||
jasmine.getEnv().requirePromises();
|
jasmine.getEnv().requirePromises();
|
||||||
|
|
||||||
var resolve,
|
var resolve,
|
||||||
promise = new Promise(function(res) { resolve = res; });
|
promise = new Promise(function(res) { resolve = res; }); // eslint-disable-line compat/compat
|
||||||
|
|
||||||
env.describe('a suite', function() {
|
env.describe('a suite', function() {
|
||||||
env.afterAll(function() {
|
env.afterAll(function() {
|
||||||
|
|||||||
@@ -335,11 +335,11 @@ describe('Matchers (Integration)', function() {
|
|||||||
|
|
||||||
describe('toBeResolved', function() {
|
describe('toBeResolved', function() {
|
||||||
verifyPassesAsync(function(env) {
|
verifyPassesAsync(function(env) {
|
||||||
return env.expectAsync(Promise.resolve()).toBeResolved();
|
return env.expectAsync(Promise.resolve()).toBeResolved(); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
verifyFailsAsync(function(env) {
|
verifyFailsAsync(function(env) {
|
||||||
return env.expectAsync(Promise.reject()).toBeResolved();
|
return env.expectAsync(Promise.reject()).toBeResolved(); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -348,11 +348,11 @@ describe('Matchers (Integration)', function() {
|
|||||||
env.addCustomEqualityTester(function(a, b) {
|
env.addCustomEqualityTester(function(a, b) {
|
||||||
return a.toString() === b.toString();
|
return a.toString() === b.toString();
|
||||||
});
|
});
|
||||||
return env.expectAsync(Promise.resolve('5')).toBeResolvedTo(5);
|
return env.expectAsync(Promise.resolve('5')).toBeResolvedTo(5); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
verifyFailsAsync(function(env) {
|
verifyFailsAsync(function(env) {
|
||||||
return env.expectAsync(Promise.resolve('foo')).toBeResolvedTo('bar');
|
return env.expectAsync(Promise.resolve('foo')).toBeResolvedTo('bar'); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
verifyFailsWithCustomObjectFormattersAsync({
|
verifyFailsWithCustomObjectFormattersAsync({
|
||||||
@@ -360,7 +360,7 @@ describe('Matchers (Integration)', function() {
|
|||||||
return '|' + val + '|';
|
return '|' + val + '|';
|
||||||
},
|
},
|
||||||
expectations: function(env) {
|
expectations: function(env) {
|
||||||
return env.expectAsync(Promise.resolve('x')).toBeResolvedTo('y');
|
return env.expectAsync(Promise.resolve('x')).toBeResolvedTo('y'); // eslint-disable-line compat/compat
|
||||||
},
|
},
|
||||||
expectedMessage: 'Expected a promise to be resolved to |y| ' +
|
expectedMessage: 'Expected a promise to be resolved to |y| ' +
|
||||||
'but it was resolved to |x|.'
|
'but it was resolved to |x|.'
|
||||||
@@ -369,11 +369,11 @@ describe('Matchers (Integration)', function() {
|
|||||||
|
|
||||||
describe('toBeRejected', function() {
|
describe('toBeRejected', function() {
|
||||||
verifyPassesAsync(function(env) {
|
verifyPassesAsync(function(env) {
|
||||||
return env.expectAsync(Promise.reject('nope')).toBeRejected();
|
return env.expectAsync(Promise.reject('nope')).toBeRejected(); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
verifyFailsAsync(function(env) {
|
verifyFailsAsync(function(env) {
|
||||||
return env.expectAsync(Promise.resolve()).toBeRejected();
|
return env.expectAsync(Promise.resolve()).toBeRejected(); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -382,11 +382,11 @@ describe('Matchers (Integration)', function() {
|
|||||||
env.addCustomEqualityTester(function(a, b) {
|
env.addCustomEqualityTester(function(a, b) {
|
||||||
return a.toString() === b.toString();
|
return a.toString() === b.toString();
|
||||||
});
|
});
|
||||||
return env.expectAsync(Promise.reject('5')).toBeRejectedWith(5);
|
return env.expectAsync(Promise.reject('5')).toBeRejectedWith(5); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
verifyFailsAsync(function(env) {
|
verifyFailsAsync(function(env) {
|
||||||
return env.expectAsync(Promise.resolve()).toBeRejectedWith('nope');
|
return env.expectAsync(Promise.resolve()).toBeRejectedWith('nope'); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
verifyFailsWithCustomObjectFormattersAsync({
|
verifyFailsWithCustomObjectFormattersAsync({
|
||||||
@@ -394,7 +394,7 @@ describe('Matchers (Integration)', function() {
|
|||||||
return '|' + val + '|';
|
return '|' + val + '|';
|
||||||
},
|
},
|
||||||
expectations: function(env) {
|
expectations: function(env) {
|
||||||
return env.expectAsync(Promise.reject('x')).toBeRejectedWith('y');
|
return env.expectAsync(Promise.reject('x')).toBeRejectedWith('y'); // eslint-disable-line compat/compat
|
||||||
},
|
},
|
||||||
expectedMessage: 'Expected a promise to be rejected with |y| ' +
|
expectedMessage: 'Expected a promise to be rejected with |y| ' +
|
||||||
'but it was rejected with |x|.'
|
'but it was rejected with |x|.'
|
||||||
@@ -403,11 +403,11 @@ describe('Matchers (Integration)', function() {
|
|||||||
|
|
||||||
describe('toBeRejectedWithError', function() {
|
describe('toBeRejectedWithError', function() {
|
||||||
verifyPassesAsync(function(env) {
|
verifyPassesAsync(function(env) {
|
||||||
return env.expectAsync(Promise.reject(new Error())).toBeRejectedWithError(Error);
|
return env.expectAsync(Promise.reject(new Error())).toBeRejectedWithError(Error); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
verifyFailsAsync(function(env) {
|
verifyFailsAsync(function(env) {
|
||||||
return env.expectAsync(Promise.resolve()).toBeRejectedWithError(Error);
|
return env.expectAsync(Promise.resolve()).toBeRejectedWithError(Error); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
verifyFailsWithCustomObjectFormattersAsync({
|
verifyFailsWithCustomObjectFormattersAsync({
|
||||||
@@ -415,7 +415,7 @@ describe('Matchers (Integration)', function() {
|
|||||||
return '|' + val + '|';
|
return '|' + val + '|';
|
||||||
},
|
},
|
||||||
expectations: function(env) {
|
expectations: function(env) {
|
||||||
return env.expectAsync(Promise.reject('foo')).toBeRejectedWithError('foo');
|
return env.expectAsync(Promise.reject('foo')).toBeRejectedWithError('foo'); // eslint-disable-line compat/compat
|
||||||
},
|
},
|
||||||
expectedMessage: 'Expected a promise to be rejected with Error: |foo| ' +
|
expectedMessage: 'Expected a promise to be rejected with Error: |foo| ' +
|
||||||
'but it was rejected with |foo|.'
|
'but it was rejected with |foo|.'
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
describe('toBePending', function() {
|
describe('toBePending', function() {
|
||||||
it('passes if the actual promise is pending', function() {
|
it('passes if the actual promise is pending', function() {
|
||||||
jasmine.getEnv().requirePromises();
|
jasmine.getEnv().requirePromises();
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
describe('toBeRejected', function() {
|
describe('toBeRejected', function() {
|
||||||
it('passes if the actual is rejected', function() {
|
it('passes if the actual is rejected', function() {
|
||||||
jasmine.getEnv().requirePromises();
|
jasmine.getEnv().requirePromises();
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
describe('#toBeRejectedWithError', function () {
|
describe('#toBeRejectedWithError', function () {
|
||||||
it('passes when Error type matches', function () {
|
it('passes when Error type matches', function () {
|
||||||
jasmine.getEnv().requirePromises();
|
jasmine.getEnv().requirePromises();
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
describe('#toBeRejectedWith', function () {
|
describe('#toBeRejectedWith', function () {
|
||||||
it('should return true if the promise is rejected with the expected value', function () {
|
it('should return true if the promise is rejected with the expected value', function () {
|
||||||
jasmine.getEnv().requirePromises();
|
jasmine.getEnv().requirePromises();
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
describe('toBeResolved', function() {
|
describe('toBeResolved', function() {
|
||||||
it('passes if the actual is resolved', function() {
|
it('passes if the actual is resolved', function() {
|
||||||
jasmine.getEnv().requirePromises();
|
jasmine.getEnv().requirePromises();
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
describe('#toBeResolvedTo', function() {
|
describe('#toBeResolvedTo', function() {
|
||||||
it('passes if the promise is resolved to the expected value', function() {
|
it('passes if the promise is resolved to the expected value', function() {
|
||||||
jasmine.getEnv().requirePromises();
|
jasmine.getEnv().requirePromises();
|
||||||
|
|||||||
@@ -282,8 +282,8 @@ describe("matchersUtil", function() {
|
|||||||
it("passes for equivalent Promises (GitHub issue #1314)", function() {
|
it("passes for equivalent Promises (GitHub issue #1314)", function() {
|
||||||
if (typeof Promise === 'undefined') { return; }
|
if (typeof Promise === 'undefined') { return; }
|
||||||
|
|
||||||
var p1 = new Promise(function () {}),
|
var p1 = new Promise(function () {}), // eslint-disable-line compat/compat
|
||||||
p2 = new Promise(function () {}),
|
p2 = new Promise(function () {}), // eslint-disable-line compat/compat
|
||||||
matchersUtil = new jasmineUnderTest.MatchersUtil();
|
matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
|
|
||||||
expect(matchersUtil.equals(p1, p1)).toBe(true);
|
expect(matchersUtil.equals(p1, p1)).toBe(true);
|
||||||
@@ -418,10 +418,10 @@ describe("matchersUtil", function() {
|
|||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
|
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var obj = new Map();
|
var obj = new Map(); // eslint-disable-line compat/compat
|
||||||
obj.set(1, 2);
|
obj.set(1, 2);
|
||||||
obj.set('foo', 'bar');
|
obj.set('foo', 'bar');
|
||||||
var containing = new jasmineUnderTest.MapContaining(new Map());
|
var containing = new jasmineUnderTest.MapContaining(new Map()); // eslint-disable-line compat/compat
|
||||||
containing.sample.set('foo', 'bar');
|
containing.sample.set('foo', 'bar');
|
||||||
|
|
||||||
expect(matchersUtil.equals(obj, containing)).toBe(true);
|
expect(matchersUtil.equals(obj, containing)).toBe(true);
|
||||||
@@ -432,10 +432,10 @@ describe("matchersUtil", function() {
|
|||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
|
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var obj = new Set();
|
var obj = new Set(); // eslint-disable-line compat/compat
|
||||||
obj.add(1);
|
obj.add(1);
|
||||||
obj.add('foo');
|
obj.add('foo');
|
||||||
var containing = new jasmineUnderTest.SetContaining(new Set());
|
var containing = new jasmineUnderTest.SetContaining(new Set()); // eslint-disable-line compat/compat
|
||||||
containing.sample.add(1);
|
containing.sample.add(1);
|
||||||
|
|
||||||
expect(matchersUtil.equals(obj, containing)).toBe(true);
|
expect(matchersUtil.equals(obj, containing)).toBe(true);
|
||||||
@@ -603,17 +603,17 @@ describe("matchersUtil", function() {
|
|||||||
it("passes when comparing two empty sets", function() {
|
it("passes when comparing two empty sets", function() {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
expect(matchersUtil.equals(new Set(), new Set())).toBe(true);
|
expect(matchersUtil.equals(new Set(), new Set())).toBe(true); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
it("passes when comparing identical sets", function() {
|
it("passes when comparing identical sets", function() {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
|
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var setA = new Set();
|
var setA = new Set(); // eslint-disable-line compat/compat
|
||||||
setA.add(6);
|
setA.add(6);
|
||||||
setA.add(5);
|
setA.add(5);
|
||||||
var setB = new Set();
|
var setB = new Set(); // eslint-disable-line compat/compat
|
||||||
setB.add(6);
|
setB.add(6);
|
||||||
setB.add(5);
|
setB.add(5);
|
||||||
|
|
||||||
@@ -624,10 +624,10 @@ describe("matchersUtil", function() {
|
|||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
|
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var setA = new Set();
|
var setA = new Set(); // eslint-disable-line compat/compat
|
||||||
setA.add(3);
|
setA.add(3);
|
||||||
setA.add(6);
|
setA.add(6);
|
||||||
var setB = new Set();
|
var setB = new Set(); // eslint-disable-line compat/compat
|
||||||
setB.add(6);
|
setB.add(6);
|
||||||
setB.add(3);
|
setB.add(3);
|
||||||
|
|
||||||
@@ -638,24 +638,23 @@ describe("matchersUtil", function() {
|
|||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
|
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var setA1 = new Set();
|
var setA1 = new Set(); // eslint-disable-line compat/compat
|
||||||
setA1.add(['a',3]);
|
setA1.add(['a',3]);
|
||||||
setA1.add([6,1]);
|
setA1.add([6,1]);
|
||||||
var setA2 = new Set();
|
var setA2 = new Set(); // eslint-disable-line compat/compat
|
||||||
setA1.add(['y',3]);
|
setA1.add(['y',3]);
|
||||||
setA1.add([6,1]);
|
setA1.add([6,1]);
|
||||||
var setA = new Set();
|
var setA = new Set(); // eslint-disable-line compat/compat
|
||||||
setA.add(setA1);
|
setA.add(setA1);
|
||||||
setA.add(setA2);
|
setA.add(setA2);
|
||||||
|
|
||||||
|
var setB1 = new Set(); // eslint-disable-line compat/compat
|
||||||
var setB1 = new Set();
|
|
||||||
setB1.add([6,1]);
|
setB1.add([6,1]);
|
||||||
setB1.add(['a',3]);
|
setB1.add(['a',3]);
|
||||||
var setB2 = new Set();
|
var setB2 = new Set(); // eslint-disable-line compat/compat
|
||||||
setB1.add([6,1]);
|
setB1.add([6,1]);
|
||||||
setB1.add(['y',3]);
|
setB1.add(['y',3]);
|
||||||
var setB = new Set();
|
var setB = new Set(); // eslint-disable-line compat/compat
|
||||||
setB.add(setB1);
|
setB.add(setB1);
|
||||||
setB.add(setB2);
|
setB.add(setB2);
|
||||||
|
|
||||||
@@ -666,10 +665,10 @@ describe("matchersUtil", function() {
|
|||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
|
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var setA = new Set();
|
var setA = new Set(); // eslint-disable-line compat/compat
|
||||||
setA.add([[1,2], [3,4]]);
|
setA.add([[1,2], [3,4]]);
|
||||||
setA.add([[5,6], [7,8]]);
|
setA.add([[5,6], [7,8]]);
|
||||||
var setB = new Set();
|
var setB = new Set(); // eslint-disable-line compat/compat
|
||||||
setB.add([[5,6], [7,8]]);
|
setB.add([[5,6], [7,8]]);
|
||||||
setB.add([[1,2], [3,4]]);
|
setB.add([[1,2], [3,4]]);
|
||||||
|
|
||||||
@@ -679,11 +678,11 @@ describe("matchersUtil", function() {
|
|||||||
it("fails for sets with different elements", function() {
|
it("fails for sets with different elements", function() {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var setA = new Set();
|
var setA = new Set(); // eslint-disable-line compat/compat
|
||||||
setA.add(6);
|
setA.add(6);
|
||||||
setA.add(3);
|
setA.add(3);
|
||||||
setA.add(5);
|
setA.add(5);
|
||||||
var setB = new Set();
|
var setB = new Set(); // eslint-disable-line compat/compat
|
||||||
setB.add(6);
|
setB.add(6);
|
||||||
setB.add(4);
|
setB.add(4);
|
||||||
setB.add(5);
|
setB.add(5);
|
||||||
@@ -694,10 +693,10 @@ describe("matchersUtil", function() {
|
|||||||
it("fails for sets of different size", function() {
|
it("fails for sets of different size", function() {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var setA = new Set();
|
var setA = new Set(); // eslint-disable-line compat/compat
|
||||||
setA.add(6);
|
setA.add(6);
|
||||||
setA.add(3);
|
setA.add(3);
|
||||||
var setB = new Set();
|
var setB = new Set(); // eslint-disable-line compat/compat
|
||||||
setB.add(6);
|
setB.add(6);
|
||||||
setB.add(4);
|
setB.add(4);
|
||||||
setB.add(5);
|
setB.add(5);
|
||||||
@@ -708,15 +707,15 @@ describe("matchersUtil", function() {
|
|||||||
it("passes when comparing two empty maps", function() {
|
it("passes when comparing two empty maps", function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
expect(matchersUtil.equals(new Map(), new Map())).toBe(true);
|
expect(matchersUtil.equals(new Map(), new Map())).toBe(true); // eslint-disable-line compat/compat
|
||||||
});
|
});
|
||||||
|
|
||||||
it("passes when comparing identical maps", function() {
|
it("passes when comparing identical maps", function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var mapA = new Map();
|
var mapA = new Map(); // eslint-disable-line compat/compat
|
||||||
mapA.set(6, 5);
|
mapA.set(6, 5);
|
||||||
var mapB = new Map();
|
var mapB = new Map(); // eslint-disable-line compat/compat
|
||||||
mapB.set(6, 5);
|
mapB.set(6, 5);
|
||||||
expect(matchersUtil.equals(mapA, mapB)).toBe(true);
|
expect(matchersUtil.equals(mapA, mapB)).toBe(true);
|
||||||
});
|
});
|
||||||
@@ -724,10 +723,10 @@ describe("matchersUtil", function() {
|
|||||||
it("passes when comparing identical maps with different insertion order", function() {
|
it("passes when comparing identical maps with different insertion order", function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var mapA = new Map();
|
var mapA = new Map(); // eslint-disable-line compat/compat
|
||||||
mapA.set("a", 3);
|
mapA.set("a", 3);
|
||||||
mapA.set(6, 1);
|
mapA.set(6, 1);
|
||||||
var mapB = new Map();
|
var mapB = new Map(); // eslint-disable-line compat/compat
|
||||||
mapB.set(6, 1);
|
mapB.set(6, 1);
|
||||||
mapB.set("a", 3);
|
mapB.set("a", 3);
|
||||||
expect(matchersUtil.equals(mapA, mapB)).toBe(true);
|
expect(matchersUtil.equals(mapA, mapB)).toBe(true);
|
||||||
@@ -736,10 +735,10 @@ describe("matchersUtil", function() {
|
|||||||
it("fails for maps with different elements", function() {
|
it("fails for maps with different elements", function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var mapA = new Map();
|
var mapA = new Map(); // eslint-disable-line compat/compat
|
||||||
mapA.set(6, 3);
|
mapA.set(6, 3);
|
||||||
mapA.set(5, 1);
|
mapA.set(5, 1);
|
||||||
var mapB = new Map();
|
var mapB = new Map(); // eslint-disable-line compat/compat
|
||||||
mapB.set(6, 4);
|
mapB.set(6, 4);
|
||||||
mapB.set(5, 1);
|
mapB.set(5, 1);
|
||||||
|
|
||||||
@@ -749,9 +748,9 @@ describe("matchersUtil", function() {
|
|||||||
it("fails for maps of different size", function() {
|
it("fails for maps of different size", function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var mapA = new Map();
|
var mapA = new Map(); // eslint-disable-line compat/compat
|
||||||
mapA.set(6, 3);
|
mapA.set(6, 3);
|
||||||
var mapB = new Map();
|
var mapB = new Map(); // eslint-disable-line compat/compat
|
||||||
mapB.set(6, 4);
|
mapB.set(6, 4);
|
||||||
mapB.set(5, 1);
|
mapB.set(5, 1);
|
||||||
expect(matchersUtil.equals(mapA, mapB)).toBe(false);
|
expect(matchersUtil.equals(mapA, mapB)).toBe(false);
|
||||||
@@ -937,7 +936,7 @@ describe("matchersUtil", function() {
|
|||||||
|
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var setItem = {'foo': 'bar'};
|
var setItem = {'foo': 'bar'};
|
||||||
var set = new Set();
|
var set = new Set(); // eslint-disable-line compat/compat
|
||||||
set.add(setItem);
|
set.add(setItem);
|
||||||
|
|
||||||
expect(matchersUtil.contains(set, setItem)).toBe(true);
|
expect(matchersUtil.contains(set, setItem)).toBe(true);
|
||||||
@@ -948,7 +947,7 @@ describe("matchersUtil", function() {
|
|||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
|
|
||||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
var set = new Set();
|
var set = new Set(); // eslint-disable-line compat/compat
|
||||||
set.add({'foo': 'bar'});
|
set.add({'foo': 'bar'});
|
||||||
|
|
||||||
expect(matchersUtil.contains(set, {'foo': 'bar'})).toBe(false);
|
expect(matchersUtil.contains(set, {'foo': 'bar'})).toBe(false);
|
||||||
|
|||||||
@@ -261,8 +261,8 @@ describe("toEqual", function() {
|
|||||||
it("reports mismatches between arrays of different types", function() {
|
it("reports mismatches between arrays of different types", function() {
|
||||||
jasmine.getEnv().requireFunctioningTypedArrays();
|
jasmine.getEnv().requireFunctioningTypedArrays();
|
||||||
|
|
||||||
var actual = new Uint32Array([1, 2, 3]),
|
var actual = new Uint32Array([1, 2, 3]), // eslint-disable-line compat/compat
|
||||||
expected = new Uint16Array([1, 2, 3]),
|
expected = new Uint16Array([1, 2, 3]), // eslint-disable-line compat/compat
|
||||||
message = "Expected Uint32Array [ 1, 2, 3 ] to equal Uint16Array [ 1, 2, 3 ].";
|
message = "Expected Uint32Array [ 1, 2, 3 ] to equal Uint16Array [ 1, 2, 3 ].";
|
||||||
|
|
||||||
expect(compareEquals(actual, expected).message).toEqual(message);
|
expect(compareEquals(actual, expected).message).toEqual(message);
|
||||||
@@ -448,9 +448,9 @@ describe("toEqual", function() {
|
|||||||
it("reports mismatches between Sets", function() {
|
it("reports mismatches between Sets", function() {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
|
|
||||||
var actual = new Set();
|
var actual = new Set(); // eslint-disable-line compat/compat
|
||||||
actual.add(1);
|
actual.add(1);
|
||||||
var expected = new Set();
|
var expected = new Set(); // eslint-disable-line compat/compat
|
||||||
expected.add(2);
|
expected.add(2);
|
||||||
var message = 'Expected Set( 1 ) to equal Set( 2 ).';
|
var message = 'Expected Set( 1 ) to equal Set( 2 ).';
|
||||||
|
|
||||||
@@ -460,9 +460,9 @@ describe("toEqual", function() {
|
|||||||
it("reports deep mismatches within Sets", function() {
|
it("reports deep mismatches within Sets", function() {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
|
|
||||||
var actual = new Set();
|
var actual = new Set(); // eslint-disable-line compat/compat
|
||||||
actual.add({x: 1});
|
actual.add({x: 1});
|
||||||
var expected = new Set();
|
var expected = new Set(); // eslint-disable-line compat/compat
|
||||||
expected.add({x: 2});
|
expected.add({x: 2});
|
||||||
var message = 'Expected Set( Object({ x: 1 }) ) to equal Set( Object({ x: 2 }) ).';
|
var message = 'Expected Set( Object({ x: 1 }) ) to equal Set( Object({ x: 2 }) ).';
|
||||||
|
|
||||||
@@ -472,9 +472,9 @@ describe("toEqual", function() {
|
|||||||
it("reports mismatches between Sets nested in objects", function() {
|
it("reports mismatches between Sets nested in objects", function() {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
|
|
||||||
var actualSet = new Set();
|
var actualSet = new Set(); // eslint-disable-line compat/compat
|
||||||
actualSet.add(1);
|
actualSet.add(1);
|
||||||
var expectedSet = new Set();
|
var expectedSet = new Set(); // eslint-disable-line compat/compat
|
||||||
expectedSet.add(2);
|
expectedSet.add(2);
|
||||||
|
|
||||||
var actual = { sets: [actualSet] };
|
var actual = { sets: [actualSet] };
|
||||||
@@ -487,10 +487,10 @@ describe("toEqual", function() {
|
|||||||
it("reports mismatches between Sets of different lengths", function() {
|
it("reports mismatches between Sets of different lengths", function() {
|
||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
|
|
||||||
var actual = new Set();
|
var actual = new Set(); // eslint-disable-line compat/compat
|
||||||
actual.add(1);
|
actual.add(1);
|
||||||
actual.add(2);
|
actual.add(2);
|
||||||
var expected = new Set();
|
var expected = new Set(); // eslint-disable-line compat/compat
|
||||||
expected.add(2);
|
expected.add(2);
|
||||||
var message = 'Expected Set( 1, 2 ) to equal Set( 2 ).';
|
var message = 'Expected Set( 1, 2 ) to equal Set( 2 ).';
|
||||||
|
|
||||||
@@ -501,10 +501,10 @@ describe("toEqual", function() {
|
|||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
|
|
||||||
// Use 'duplicate' object in actual so sizes match
|
// Use 'duplicate' object in actual so sizes match
|
||||||
var actual = new Set();
|
var actual = new Set(); // eslint-disable-line compat/compat
|
||||||
actual.add({x: 1});
|
actual.add({x: 1});
|
||||||
actual.add({x: 1});
|
actual.add({x: 1});
|
||||||
var expected = new Set();
|
var expected = new Set(); // eslint-disable-line compat/compat
|
||||||
expected.add({x: 1});
|
expected.add({x: 1});
|
||||||
expected.add({x: 2});
|
expected.add({x: 2});
|
||||||
var message = 'Expected Set( Object({ x: 1 }), Object({ x: 1 }) ) to equal Set( Object({ x: 1 }), Object({ x: 2 }) ).';
|
var message = 'Expected Set( Object({ x: 1 }), Object({ x: 1 }) ) to equal Set( Object({ x: 1 }), Object({ x: 2 }) ).';
|
||||||
@@ -516,10 +516,10 @@ describe("toEqual", function() {
|
|||||||
jasmine.getEnv().requireFunctioningSets();
|
jasmine.getEnv().requireFunctioningSets();
|
||||||
|
|
||||||
// Use 'duplicate' object in expected so sizes match
|
// Use 'duplicate' object in expected so sizes match
|
||||||
var actual = new Set();
|
var actual = new Set(); // eslint-disable-line compat/compat
|
||||||
actual.add({x: 1});
|
actual.add({x: 1});
|
||||||
actual.add({x: 2});
|
actual.add({x: 2});
|
||||||
var expected = new Set();
|
var expected = new Set(); // eslint-disable-line compat/compat
|
||||||
expected.add({x: 1});
|
expected.add({x: 1});
|
||||||
expected.add({x: 1});
|
expected.add({x: 1});
|
||||||
var message = 'Expected Set( Object({ x: 1 }), Object({ x: 2 }) ) to equal Set( Object({ x: 1 }), Object({ x: 1 }) ).';
|
var message = 'Expected Set( Object({ x: 1 }), Object({ x: 2 }) ) to equal Set( Object({ x: 1 }), Object({ x: 1 }) ).';
|
||||||
@@ -533,9 +533,9 @@ describe("toEqual", function() {
|
|||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
|
|
||||||
// values are the same but with different object identity
|
// values are the same but with different object identity
|
||||||
var actual = new Map();
|
var actual = new Map(); // eslint-disable-line compat/compat
|
||||||
actual.set('a',{x:1});
|
actual.set('a',{x:1});
|
||||||
var expected = new Map();
|
var expected = new Map(); // eslint-disable-line compat/compat
|
||||||
expected.set('a',{x:1});
|
expected.set('a',{x:1});
|
||||||
|
|
||||||
expect(compareEquals(actual, expected).pass).toBe(true);
|
expect(compareEquals(actual, expected).pass).toBe(true);
|
||||||
@@ -544,9 +544,9 @@ describe("toEqual", function() {
|
|||||||
it("reports deep mismatches within Maps", function() {
|
it("reports deep mismatches within Maps", function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
|
|
||||||
var actual = new Map();
|
var actual = new Map(); // eslint-disable-line compat/compat
|
||||||
actual.set('a',{x:1});
|
actual.set('a',{x:1});
|
||||||
var expected = new Map();
|
var expected = new Map(); // eslint-disable-line compat/compat
|
||||||
expected.set('a',{x:2});
|
expected.set('a',{x:2});
|
||||||
var message = "Expected Map( [ 'a', Object({ x: 1 }) ] ) to equal Map( [ 'a', Object({ x: 2 }) ] ).";
|
var message = "Expected Map( [ 'a', Object({ x: 1 }) ] ) to equal Map( [ 'a', Object({ x: 2 }) ] ).";
|
||||||
|
|
||||||
@@ -556,9 +556,9 @@ describe("toEqual", function() {
|
|||||||
it("reports mismatches between Maps nested in objects", function() {
|
it("reports mismatches between Maps nested in objects", function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
|
|
||||||
var actual = {Maps:[new Map()]};
|
var actual = {Maps:[new Map()]}; // eslint-disable-line compat/compat
|
||||||
actual.Maps[0].set('a',1);
|
actual.Maps[0].set('a',1);
|
||||||
var expected = {Maps:[new Map()]};
|
var expected = {Maps:[new Map()]}; // eslint-disable-line compat/compat
|
||||||
expected.Maps[0].set('a',2);
|
expected.Maps[0].set('a',2);
|
||||||
|
|
||||||
var message = "Expected $.Maps[0] = Map( [ 'a', 1 ] ) to equal Map( [ 'a', 2 ] ).";
|
var message = "Expected $.Maps[0] = Map( [ 'a', 1 ] ) to equal Map( [ 'a', 2 ] ).";
|
||||||
@@ -569,9 +569,9 @@ describe("toEqual", function() {
|
|||||||
it("reports mismatches between Maps of different lengths", function() {
|
it("reports mismatches between Maps of different lengths", function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
|
|
||||||
var actual = new Map();
|
var actual = new Map(); // eslint-disable-line compat/compat
|
||||||
actual.set('a',1);
|
actual.set('a',1);
|
||||||
var expected = new Map();
|
var expected = new Map(); // eslint-disable-line compat/compat
|
||||||
expected.set('a',2);
|
expected.set('a',2);
|
||||||
expected.set('b',1);
|
expected.set('b',1);
|
||||||
var message = "Expected Map( [ 'a', 1 ] ) to equal Map( [ 'a', 2 ], [ 'b', 1 ] ).";
|
var message = "Expected Map( [ 'a', 1 ] ) to equal Map( [ 'a', 2 ], [ 'b', 1 ] ).";
|
||||||
@@ -582,9 +582,9 @@ describe("toEqual", function() {
|
|||||||
it("reports mismatches between Maps with equal values but differing keys", function() {
|
it("reports mismatches between Maps with equal values but differing keys", function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
|
|
||||||
var actual = new Map();
|
var actual = new Map(); // eslint-disable-line compat/compat
|
||||||
actual.set('a',1);
|
actual.set('a',1);
|
||||||
var expected = new Map();
|
var expected = new Map(); // eslint-disable-line compat/compat
|
||||||
expected.set('b',1);
|
expected.set('b',1);
|
||||||
var message = "Expected Map( [ 'a', 1 ] ) to equal Map( [ 'b', 1 ] ).";
|
var message = "Expected Map( [ 'a', 1 ] ) to equal Map( [ 'b', 1 ] ).";
|
||||||
|
|
||||||
@@ -594,9 +594,9 @@ describe("toEqual", function() {
|
|||||||
it("does not report mismatches between Maps with keys with same object identity", function() {
|
it("does not report mismatches between Maps with keys with same object identity", function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
var key = {x: 1};
|
var key = {x: 1};
|
||||||
var actual = new Map();
|
var actual = new Map(); // eslint-disable-line compat/compat
|
||||||
actual.set(key,2);
|
actual.set(key,2);
|
||||||
var expected = new Map();
|
var expected = new Map(); // eslint-disable-line compat/compat
|
||||||
expected.set(key,2);
|
expected.set(key,2);
|
||||||
|
|
||||||
expect(compareEquals(actual, expected).pass).toBe(true);
|
expect(compareEquals(actual, expected).pass).toBe(true);
|
||||||
@@ -605,9 +605,9 @@ describe("toEqual", function() {
|
|||||||
it("reports mismatches between Maps with identical keys with different object identity", function() {
|
it("reports mismatches between Maps with identical keys with different object identity", function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
|
|
||||||
var actual = new Map();
|
var actual = new Map(); // eslint-disable-line compat/compat
|
||||||
actual.set({x:1},2);
|
actual.set({x:1},2);
|
||||||
var expected = new Map();
|
var expected = new Map(); // eslint-disable-line compat/compat
|
||||||
expected.set({x:1},2);
|
expected.set({x:1},2);
|
||||||
var message = "Expected Map( [ Object({ x: 1 }), 2 ] ) to equal Map( [ Object({ x: 1 }), 2 ] ).";
|
var message = "Expected Map( [ Object({ x: 1 }), 2 ] ) to equal Map( [ Object({ x: 1 }), 2 ] ).";
|
||||||
|
|
||||||
@@ -617,9 +617,9 @@ describe("toEqual", function() {
|
|||||||
it("does not report mismatches when comparing Map key to jasmine.anything()", function() {
|
it("does not report mismatches when comparing Map key to jasmine.anything()", function() {
|
||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
|
|
||||||
var actual = new Map();
|
var actual = new Map(); // eslint-disable-line compat/compat
|
||||||
actual.set('a',1);
|
actual.set('a',1);
|
||||||
var expected = new Map();
|
var expected = new Map(); // eslint-disable-line compat/compat
|
||||||
expected.set(jasmineUnderTest.anything(),1);
|
expected.set(jasmineUnderTest.anything(),1);
|
||||||
|
|
||||||
expect(compareEquals(actual, expected).pass).toBe(true);
|
expect(compareEquals(actual, expected).pass).toBe(true);
|
||||||
@@ -629,10 +629,10 @@ describe("toEqual", function() {
|
|||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
jasmine.getEnv().requireFunctioningSymbols();
|
jasmine.getEnv().requireFunctioningSymbols();
|
||||||
|
|
||||||
var key = Symbol();
|
var key = Symbol(); // eslint-disable-line compat/compat
|
||||||
var actual = new Map();
|
var actual = new Map(); // eslint-disable-line compat/compat
|
||||||
actual.set(key,1);
|
actual.set(key,1);
|
||||||
var expected = new Map();
|
var expected = new Map(); // eslint-disable-line compat/compat
|
||||||
expected.set(key,1);
|
expected.set(key,1);
|
||||||
|
|
||||||
expect(compareEquals(actual, expected).pass).toBe(true);
|
expect(compareEquals(actual, expected).pass).toBe(true);
|
||||||
@@ -642,10 +642,10 @@ describe("toEqual", function() {
|
|||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
jasmine.getEnv().requireFunctioningSymbols();
|
jasmine.getEnv().requireFunctioningSymbols();
|
||||||
|
|
||||||
var actual = new Map();
|
var actual = new Map(); // eslint-disable-line compat/compat
|
||||||
actual.set(Symbol(),1);
|
actual.set(Symbol(),1); // eslint-disable-line compat/compat
|
||||||
var expected = new Map();
|
var expected = new Map(); // eslint-disable-line compat/compat
|
||||||
expected.set(Symbol(),1);
|
expected.set(Symbol(),1); // eslint-disable-line compat/compat
|
||||||
var message = "Expected Map( [ Symbol(), 1 ] ) to equal Map( [ Symbol(), 1 ] ).";
|
var message = "Expected Map( [ Symbol(), 1 ] ) to equal Map( [ Symbol(), 1 ] ).";
|
||||||
|
|
||||||
expect(compareEquals(actual, expected).message).toBe(message);
|
expect(compareEquals(actual, expected).message).toBe(message);
|
||||||
@@ -655,9 +655,9 @@ describe("toEqual", function() {
|
|||||||
jasmine.getEnv().requireFunctioningMaps();
|
jasmine.getEnv().requireFunctioningMaps();
|
||||||
jasmine.getEnv().requireFunctioningSymbols();
|
jasmine.getEnv().requireFunctioningSymbols();
|
||||||
|
|
||||||
var actual = new Map();
|
var actual = new Map(); // eslint-disable-line compat/compat
|
||||||
actual.set(Symbol(),1);
|
actual.set(Symbol(),1); // eslint-disable-line compat/compat
|
||||||
var expected = new Map();
|
var expected = new Map(); // eslint-disable-line compat/compat
|
||||||
expected.set(jasmineUnderTest.anything(),1);
|
expected.set(jasmineUnderTest.anything(),1);
|
||||||
|
|
||||||
expect(compareEquals(actual, expected).pass).toBe(true);
|
expect(compareEquals(actual, expected).pass).toBe(true);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
describe('toHaveSize', function() {
|
describe('toHaveSize', function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
(function(env) {
|
(function(env) {
|
||||||
env.hasFunctioningMaps = function() {
|
env.hasFunctioningMaps = function() {
|
||||||
if (typeof Map === 'undefined') {
|
if (typeof Map === 'undefined') {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
(function(env) {
|
(function(env) {
|
||||||
env.hasFunctioningSets = function() {
|
env.hasFunctioningSets = function() {
|
||||||
if (typeof Set === 'undefined') {
|
if (typeof Set === 'undefined') {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
(function(env) {
|
(function(env) {
|
||||||
function hasFunctioningSymbols() {
|
function hasFunctioningSymbols() {
|
||||||
if (typeof Symbol === 'undefined') {
|
if (typeof Symbol === 'undefined') {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
(function(env) {
|
(function(env) {
|
||||||
function hasFunctioningTypedArrays() {
|
function hasFunctioningTypedArrays() {
|
||||||
if (typeof Uint32Array === 'undefined') {
|
if (typeof Uint32Array === 'undefined') {
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ getJasmineRequireObj().asymmetricEqualityTesterArgCompatShim = function(j$) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
props = Object.getOwnPropertyDescriptors(Array.prototype);
|
props = Object.getOwnPropertyDescriptors(Array.prototype); // eslint-disable-line compat/compat
|
||||||
a = [];
|
a = [];
|
||||||
|
|
||||||
for (k in props) {
|
for (k in props) {
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
|
/* eslint-disable compat/compat */
|
||||||
getJasmineRequireObj().toBePending = function(j$) {
|
getJasmineRequireObj().toBePending = function(j$) {
|
||||||
/**
|
/**
|
||||||
* Expect a promise to be pending, ie. the promise is neither resolved nor rejected.
|
* Expect a promise to be pending, ie. the promise is neither resolved nor rejected.
|
||||||
* @function
|
* @function
|
||||||
* @async
|
* @async
|
||||||
* @name async-matchers#toBePending
|
* @name async-matchers#toBePending
|
||||||
* @since 3.5.1 (should this be the next version or the version when it was added?)
|
* @since 3.6
|
||||||
* @example
|
* @example
|
||||||
* await expectAsync(aPromise).toBePending();
|
* await expectAsync(aPromise).toBePending();
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ getJasmineRequireObj().toHaveSize = function(j$) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; // eslint-disable-line compat/compat
|
||||||
function isLength(value) {
|
function isLength(value) {
|
||||||
return (typeof value == 'number') && value > -1 && value % 1 === 0 && value <= MAX_SAFE_INTEGER;
|
return (typeof value == 'number') && value > -1 && value % 1 === 0 && value <= MAX_SAFE_INTEGER;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user