Fixed pending() for async/promise-returning specs
Fixes #1449. Fixes #1450.
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user