Removed support for Internet Explorer
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable compat/compat */
|
||||
describe('Custom Async Matchers (Integration)', function() {
|
||||
var env;
|
||||
|
||||
@@ -12,8 +11,6 @@ describe('Custom Async Matchers (Integration)', function() {
|
||||
});
|
||||
|
||||
it('passes the spec if the custom async matcher passes', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
env.it('spec using custom async matcher', function() {
|
||||
env.addAsyncMatchers({
|
||||
toBeReal: function() {
|
||||
@@ -37,8 +34,6 @@ describe('Custom Async Matchers (Integration)', function() {
|
||||
});
|
||||
|
||||
it('uses the negative compare function for a negative comparison, if provided', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
env.it('spec with custom negative comparison matcher', function() {
|
||||
env.addAsyncMatchers({
|
||||
toBeReal: function() {
|
||||
@@ -65,8 +60,6 @@ describe('Custom Async Matchers (Integration)', function() {
|
||||
});
|
||||
|
||||
it('generates messages with the same rules as built in matchers absent a custom message', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
env.it('spec with an expectation', function() {
|
||||
env.addAsyncMatchers({
|
||||
toBeReal: function() {
|
||||
@@ -92,8 +85,6 @@ describe('Custom Async Matchers (Integration)', function() {
|
||||
});
|
||||
|
||||
it('passes the jasmine utility to the matcher factory', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
var matcherFactory = function(util) {
|
||||
return {
|
||||
compare: function() {
|
||||
@@ -125,8 +116,6 @@ describe('Custom Async Matchers (Integration)', function() {
|
||||
});
|
||||
|
||||
it('provides custom equality testers to the matcher factory via matchersUtil', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
var matcherFactory = function(matchersUtil) {
|
||||
return {
|
||||
compare: function(actual, expected) {
|
||||
|
||||
@@ -156,10 +156,6 @@ describe('Env integration', function() {
|
||||
message: 'Failed: error message',
|
||||
stack: {
|
||||
asymmetricMatch: function(other) {
|
||||
if (!other) {
|
||||
// IE doesn't give us a stacktrace so just ignore it.
|
||||
return true;
|
||||
}
|
||||
var split = other.split('\n'),
|
||||
firstLine = split[0];
|
||||
if (firstLine.indexOf('error message') >= 0) {
|
||||
@@ -2709,8 +2705,6 @@ describe('Env integration', function() {
|
||||
});
|
||||
|
||||
it('supports async matchers', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
var specDone = jasmine.createSpy('specDone'),
|
||||
suiteDone = jasmine.createSpy('suiteDone'),
|
||||
jasmineDone = jasmine.createSpy('jasmineDone');
|
||||
@@ -2723,7 +2717,6 @@ describe('Env integration', function() {
|
||||
|
||||
function fail(innerDone) {
|
||||
var resolve;
|
||||
// eslint-disable-next-line compat/compat
|
||||
var p = new Promise(function(res, rej) {
|
||||
resolve = res;
|
||||
});
|
||||
@@ -2779,8 +2772,6 @@ describe('Env integration', function() {
|
||||
jasmine.getEnv().skipBrowserFlake();
|
||||
}
|
||||
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
var specDone = jasmine.createSpy('specDone');
|
||||
|
||||
env.addReporter({ specDone: specDone });
|
||||
@@ -2789,7 +2780,7 @@ describe('Env integration', function() {
|
||||
env.addCustomEqualityTester(function() {
|
||||
return true;
|
||||
});
|
||||
var p = Promise.resolve('something'); // eslint-disable-line compat/compat
|
||||
var p = Promise.resolve('something');
|
||||
return env.expectAsync(p).toBeResolvedTo('something else');
|
||||
});
|
||||
|
||||
@@ -2805,8 +2796,6 @@ describe('Env integration', function() {
|
||||
});
|
||||
|
||||
it('includes useful stack frames in async matcher failures', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
var specDone = jasmine.createSpy('specDone');
|
||||
|
||||
env.addReporter({ specDone: specDone });
|
||||
@@ -2815,7 +2804,7 @@ describe('Env integration', function() {
|
||||
env.addCustomEqualityTester(function() {
|
||||
return true;
|
||||
});
|
||||
var p = Promise.resolve(); // eslint-disable-line compat/compat
|
||||
var p = Promise.resolve();
|
||||
return env.expectAsync(p).toBeRejected();
|
||||
});
|
||||
|
||||
@@ -2834,11 +2823,8 @@ describe('Env integration', function() {
|
||||
});
|
||||
|
||||
it('reports an error when an async expectation occurs after the spec finishes', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
var resolve,
|
||||
jasmineDone = jasmine.createSpy('jasmineDone'),
|
||||
// eslint-disable-next-line compat/compat
|
||||
promise = new Promise(function(res) {
|
||||
resolve = res;
|
||||
});
|
||||
@@ -2897,11 +2883,8 @@ describe('Env integration', function() {
|
||||
});
|
||||
|
||||
it('reports an error when an async expectation occurs after the suite finishes', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
var resolve,
|
||||
jasmineDone = jasmine.createSpy('jasmineDone'),
|
||||
// eslint-disable-next-line compat/compat
|
||||
promise = new Promise(function(res) {
|
||||
resolve = res;
|
||||
});
|
||||
|
||||
@@ -90,8 +90,6 @@ describe('Matchers (Integration)', function() {
|
||||
|
||||
function verifyPassesAsync(expectations) {
|
||||
it('passes', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
env.it('a spec', function() {
|
||||
return expectations(env);
|
||||
});
|
||||
@@ -118,8 +116,6 @@ describe('Matchers (Integration)', function() {
|
||||
|
||||
function verifyFailsAsync(expectations) {
|
||||
it('fails', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
env.it('a spec', function() {
|
||||
return expectations(env);
|
||||
});
|
||||
@@ -147,7 +143,6 @@ describe('Matchers (Integration)', function() {
|
||||
function verifyFailsWithCustomObjectFormattersAsync(config) {
|
||||
it('uses custom object formatters', function(done) {
|
||||
var env = new jasmineUnderTest.Env();
|
||||
jasmine.getEnv().requirePromises();
|
||||
env.it('a spec', function() {
|
||||
env.addCustomObjectFormatter(config.formatter);
|
||||
return config.expectations(env);
|
||||
@@ -348,12 +343,10 @@ describe('Matchers (Integration)', function() {
|
||||
|
||||
describe('toBeResolved', function() {
|
||||
verifyPassesAsync(function(env) {
|
||||
// eslint-disable-next-line compat/compat
|
||||
return env.expectAsync(Promise.resolve()).toBeResolved();
|
||||
});
|
||||
|
||||
verifyFailsAsync(function(env) {
|
||||
// eslint-disable-next-line compat/compat
|
||||
return env.expectAsync(Promise.reject()).toBeResolved();
|
||||
});
|
||||
});
|
||||
@@ -363,12 +356,10 @@ describe('Matchers (Integration)', function() {
|
||||
env.addCustomEqualityTester(function(a, b) {
|
||||
return a.toString() === b.toString();
|
||||
});
|
||||
// eslint-disable-next-line compat/compat
|
||||
return env.expectAsync(Promise.resolve('5')).toBeResolvedTo(5);
|
||||
});
|
||||
|
||||
verifyFailsAsync(function(env) {
|
||||
// eslint-disable-next-line compat/compat
|
||||
return env.expectAsync(Promise.resolve('foo')).toBeResolvedTo('bar');
|
||||
});
|
||||
|
||||
@@ -377,7 +368,6 @@ describe('Matchers (Integration)', function() {
|
||||
return '|' + val + '|';
|
||||
},
|
||||
expectations: function(env) {
|
||||
// eslint-disable-next-line compat/compat
|
||||
return env.expectAsync(Promise.resolve('x')).toBeResolvedTo('y');
|
||||
},
|
||||
expectedMessage:
|
||||
@@ -388,12 +378,10 @@ describe('Matchers (Integration)', function() {
|
||||
|
||||
describe('toBeRejected', function() {
|
||||
verifyPassesAsync(function(env) {
|
||||
// eslint-disable-next-line compat/compat
|
||||
return env.expectAsync(Promise.reject('nope')).toBeRejected();
|
||||
});
|
||||
|
||||
verifyFailsAsync(function(env) {
|
||||
// eslint-disable-next-line compat/compat
|
||||
return env.expectAsync(Promise.resolve()).toBeRejected();
|
||||
});
|
||||
});
|
||||
@@ -403,12 +391,10 @@ describe('Matchers (Integration)', function() {
|
||||
env.addCustomEqualityTester(function(a, b) {
|
||||
return a.toString() === b.toString();
|
||||
});
|
||||
// eslint-disable-next-line compat/compat
|
||||
return env.expectAsync(Promise.reject('5')).toBeRejectedWith(5);
|
||||
});
|
||||
|
||||
verifyFailsAsync(function(env) {
|
||||
// eslint-disable-next-line compat/compat
|
||||
return env.expectAsync(Promise.resolve()).toBeRejectedWith('nope');
|
||||
});
|
||||
|
||||
@@ -417,7 +403,6 @@ describe('Matchers (Integration)', function() {
|
||||
return '|' + val + '|';
|
||||
},
|
||||
expectations: function(env) {
|
||||
// eslint-disable-next-line compat/compat
|
||||
return env.expectAsync(Promise.reject('x')).toBeRejectedWith('y');
|
||||
},
|
||||
expectedMessage:
|
||||
@@ -428,16 +413,12 @@ describe('Matchers (Integration)', function() {
|
||||
|
||||
describe('toBeRejectedWithError', function() {
|
||||
verifyPassesAsync(function(env) {
|
||||
return (
|
||||
env
|
||||
// eslint-disable-next-line compat/compat
|
||||
.expectAsync(Promise.reject(new Error()))
|
||||
.toBeRejectedWithError(Error)
|
||||
);
|
||||
return env
|
||||
.expectAsync(Promise.reject(new Error()))
|
||||
.toBeRejectedWithError(Error);
|
||||
});
|
||||
|
||||
verifyFailsAsync(function(env) {
|
||||
// eslint-disable-next-line compat/compat
|
||||
return env.expectAsync(Promise.resolve()).toBeRejectedWithError(Error);
|
||||
});
|
||||
|
||||
@@ -446,12 +427,9 @@ describe('Matchers (Integration)', function() {
|
||||
return '|' + val + '|';
|
||||
},
|
||||
expectations: function(env) {
|
||||
return (
|
||||
env
|
||||
// eslint-disable-next-line compat/compat
|
||||
.expectAsync(Promise.reject('foo'))
|
||||
.toBeRejectedWithError('foo')
|
||||
);
|
||||
return env
|
||||
.expectAsync(Promise.reject('foo'))
|
||||
.toBeRejectedWithError('foo');
|
||||
},
|
||||
expectedMessage:
|
||||
'Expected a promise to be rejected with Error: |foo| ' +
|
||||
@@ -757,10 +735,7 @@ describe('Matchers (Integration)', function() {
|
||||
|
||||
describe('When an async matcher is used with .already()', function() {
|
||||
it('propagates the matcher result when the promise is resolved', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
env.it('a spec', function() {
|
||||
// eslint-disable-next-line compat/compat
|
||||
return env.expectAsync(Promise.resolve()).already.toBeRejected();
|
||||
});
|
||||
|
||||
@@ -782,15 +757,10 @@ describe('Matchers (Integration)', function() {
|
||||
});
|
||||
|
||||
it('propagates the matcher result when the promise is rejected', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
env.it('a spec', function() {
|
||||
return (
|
||||
env
|
||||
// eslint-disable-next-line compat/compat
|
||||
.expectAsync(Promise.reject(new Error('nope')))
|
||||
.already.toBeResolved()
|
||||
);
|
||||
return env
|
||||
.expectAsync(Promise.reject(new Error('nope')))
|
||||
.already.toBeResolved();
|
||||
});
|
||||
|
||||
var specExpectations = function(result) {
|
||||
@@ -812,9 +782,6 @@ describe('Matchers (Integration)', function() {
|
||||
});
|
||||
|
||||
it('fails when the promise is pending', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
// eslint-disable-next-line compat/compat
|
||||
var promise = new Promise(function() {});
|
||||
|
||||
env.it('a spec', function() {
|
||||
|
||||
Reference in New Issue
Block a user