Fixed pending() for async/promise-returning specs

Fixes #1449.
Fixes #1450.
This commit is contained in:
Steve Gravrock
2017-11-29 08:56:12 -08:00
parent 13b9e669bd
commit f4caf27208
4 changed files with 50 additions and 7 deletions

View File

@@ -125,7 +125,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
var maybeThenable = queueableFn.fn.call(self.userContext);
if (maybeThenable && j$.isFunction_(maybeThenable.then)) {
maybeThenable.then(next, next.fail);
maybeThenable.then(next, onPromiseRejection);
completedSynchronously = false;
return { completedSynchronously: false };
}
@@ -147,6 +147,11 @@ getJasmineRequireObj().QueueRunner = function(j$) {
errored = true;
}
function onPromiseRejection(e) {
onException(e);
next();
}
function handleException(e, queueableFn) {
onException(e);
if (!self.catchException(e)) {