Merge branch 'main' into 3.99
This commit is contained in:
@@ -8407,7 +8407,6 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|||||||
// TODO probably shouldn't next() right away here.
|
// TODO probably shouldn't next() right away here.
|
||||||
// That makes debugging async failures much more confusing.
|
// That makes debugging async failures much more confusing.
|
||||||
onException(error);
|
onException(error);
|
||||||
next(error);
|
|
||||||
},
|
},
|
||||||
cleanup = once(function cleanup() {
|
cleanup = once(function cleanup() {
|
||||||
if (timeoutId !== void 0) {
|
if (timeoutId !== void 0) {
|
||||||
|
|||||||
@@ -783,9 +783,13 @@ describe('QueueRunner', function() {
|
|||||||
jasmine.clock().uninstall();
|
jasmine.clock().uninstall();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('skips to cleanup functions on the first exception', function() {
|
it('skips to cleanup functions once the fn completes after an unhandled exception', function() {
|
||||||
var errorListeners = [],
|
var errorListeners = [],
|
||||||
queueableFn = { fn: function(done) {} },
|
queueableFn = {
|
||||||
|
fn: function(done) {
|
||||||
|
queueableFnDone = done;
|
||||||
|
}
|
||||||
|
},
|
||||||
nextQueueableFn = { fn: jasmine.createSpy('nextFunction') },
|
nextQueueableFn = { fn: jasmine.createSpy('nextFunction') },
|
||||||
cleanupFn = { fn: jasmine.createSpy('cleanup') },
|
cleanupFn = { fn: jasmine.createSpy('cleanup') },
|
||||||
queueRunner = new jasmineUnderTest.QueueRunner({
|
queueRunner = new jasmineUnderTest.QueueRunner({
|
||||||
@@ -800,10 +804,13 @@ describe('QueueRunner', function() {
|
|||||||
queueableFns: [queueableFn, nextQueueableFn],
|
queueableFns: [queueableFn, nextQueueableFn],
|
||||||
cleanupFns: [cleanupFn],
|
cleanupFns: [cleanupFn],
|
||||||
completeOnFirstError: true
|
completeOnFirstError: true
|
||||||
});
|
}),
|
||||||
|
queueableFnDone;
|
||||||
|
|
||||||
queueRunner.execute();
|
queueRunner.execute();
|
||||||
errorListeners[errorListeners.length - 1](new Error('error'));
|
errorListeners[errorListeners.length - 1](new Error('error'));
|
||||||
|
expect(cleanupFn.fn).not.toHaveBeenCalled();
|
||||||
|
queueableFnDone();
|
||||||
expect(nextQueueableFn.fn).not.toHaveBeenCalled();
|
expect(nextQueueableFn.fn).not.toHaveBeenCalled();
|
||||||
expect(cleanupFn.fn).toHaveBeenCalled();
|
expect(cleanupFn.fn).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|||||||
// TODO probably shouldn't next() right away here.
|
// TODO probably shouldn't next() right away here.
|
||||||
// That makes debugging async failures much more confusing.
|
// That makes debugging async failures much more confusing.
|
||||||
onException(error);
|
onException(error);
|
||||||
next(error);
|
|
||||||
},
|
},
|
||||||
cleanup = once(function cleanup() {
|
cleanup = once(function cleanup() {
|
||||||
if (timeoutId !== void 0) {
|
if (timeoutId !== void 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user