Detect an Error passed to done and add an expectation failure

- See #567
This commit is contained in:
Gregg Van Hove
2018-01-29 16:46:30 -08:00
parent 262a2fe674
commit 46cc48ccfa
6 changed files with 107 additions and 56 deletions

View File

@@ -5,7 +5,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
return function() {
if (!called) {
called = true;
fn();
fn.apply(null, arguments);
}
return null;
};
@@ -59,15 +59,20 @@ getJasmineRequireObj().QueueRunner = function(j$) {
var self = this, completedSynchronously = true,
handleError = function handleError(error) {
onException(error);
next();
next(error);
},
cleanup = once(function cleanup() {
self.clearTimeout(timeoutId);
self.globalErrors.popListener(handleError);
}),
next = once(function next() {
next = once(function next(err) {
cleanup();
if (j$.isError_(err)) {
self.fail(err);
errored = true;
}
function runNext() {
if (self.completeOnFirstError && errored) {
self.skipToCleanup(iterativeIndex);