Rm dead code for QueueRunner deprecations

This commit is contained in:
Steve Gravrock
2022-08-11 19:51:08 -07:00
parent 588283cfe5
commit 2e80ec0c22
4 changed files with 1 additions and 33 deletions

View File

@@ -1522,7 +1522,6 @@ getJasmineRequireObj().Env = function(j$) {
function(e) {
(runner.currentRunable() || topSuite).handleException(e);
};
options.deprecated = self.deprecated;
new j$.QueueRunner(options).execute();
}
@@ -7481,7 +7480,6 @@ getJasmineRequireObj().QueueRunner = function(j$) {
if (typeof this.onComplete !== 'function') {
throw new Error('invalid onComplete ' + JSON.stringify(this.onComplete));
}
this.deprecated = attrs.deprecated;
}
QueueRunner.prototype.execute = function() {

View File

@@ -185,43 +185,20 @@ describe('QueueRunner', function() {
queueRunner.execute();
});
it('does not log a deprecation', function(done) {
const err = new Error('foo'),
queueableFn1 = {
fn: function() {
return Promise.resolve(err);
}
},
deprecated = jasmine.createSpy('deprecated'),
queueRunner = new jasmineUnderTest.QueueRunner({
queueableFns: [queueableFn1],
deprecated: deprecated,
onComplete: function() {
expect(deprecated).not.toHaveBeenCalled();
done();
}
});
queueRunner.execute();
});
});
describe('and the argument is not an Error', function() {
it('does not log a deprecation or report a failure', function(done) {
it('does not report a failure', function(done) {
const queueableFn1 = {
fn: function() {
return Promise.resolve('not an error');
}
},
failFn = jasmine.createSpy('fail'),
deprecated = jasmine.createSpy('deprecated'),
queueRunner = new jasmineUnderTest.QueueRunner({
queueableFns: [queueableFn1],
deprecated: deprecated,
fail: failFn,
onComplete: function() {
expect(deprecated).not.toHaveBeenCalled();
expect(failFn).not.toHaveBeenCalled();
done();
}
@@ -406,17 +383,12 @@ describe('QueueRunner', function() {
}
},
nextQueueableFn = { fn: jasmine.createSpy('nextFn') },
deprecated = jasmine.createSpy('deprecated'),
queueRunner = new jasmineUnderTest.QueueRunner({
deprecated: deprecated,
queueableFns: [queueableFn, nextQueueableFn]
});
queueRunner.execute();
jasmine.clock().tick(1);
expect(nextQueueableFn.fn.calls.count()).toEqual(1);
// Don't issue a deprecation. The error already tells the user that
// something went wrong.
expect(deprecated).not.toHaveBeenCalled();
});
it('should return a null when you call done', function() {

View File

@@ -380,7 +380,6 @@ getJasmineRequireObj().Env = function(j$) {
function(e) {
(runner.currentRunable() || topSuite).handleException(e);
};
options.deprecated = self.deprecated;
new j$.QueueRunner(options).execute();
}

View File

@@ -71,7 +71,6 @@ getJasmineRequireObj().QueueRunner = function(j$) {
if (typeof this.onComplete !== 'function') {
throw new Error('invalid onComplete ' + JSON.stringify(this.onComplete));
}
this.deprecated = attrs.deprecated;
}
QueueRunner.prototype.execute = function() {