Merge branch 'jasmine:main' into main
This commit is contained in:
@@ -40,7 +40,7 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
|
||||
this.emitScalar('<global>');
|
||||
} else if (value.jasmineToString) {
|
||||
this.emitScalar(value.jasmineToString(this.pp_));
|
||||
} else if (typeof value === 'string') {
|
||||
} else if (j$.isString_(value)) {
|
||||
this.emitString(value);
|
||||
} else if (j$.isSpy(value)) {
|
||||
this.emitScalar('spy on ' + value.and.identity);
|
||||
|
||||
@@ -177,7 +177,10 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
||||
maybeThenable = queueableFn.fn.call(self.userContext);
|
||||
|
||||
if (maybeThenable && j$.isFunction_(maybeThenable.then)) {
|
||||
maybeThenable.then(next, onPromiseRejection);
|
||||
maybeThenable.then(
|
||||
wrapInPromiseResolutionHandler(next),
|
||||
onPromiseRejection
|
||||
);
|
||||
completedSynchronously = false;
|
||||
return { completedSynchronously: false };
|
||||
}
|
||||
@@ -276,5 +279,15 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
||||
}
|
||||
};
|
||||
|
||||
function wrapInPromiseResolutionHandler(fn) {
|
||||
return function(maybeArg) {
|
||||
if (j$.isError_(maybeArg)) {
|
||||
fn(maybeArg);
|
||||
} else {
|
||||
fn();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return QueueRunner;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user