Merge branch '3.99' into 4.0

This commit is contained in:
Steve Gravrock
2021-07-10 09:13:28 -07:00
36 changed files with 1043 additions and 277 deletions

View File

@@ -201,6 +201,19 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
return matches ? matches[1] : '<anonymous>';
};
j$.isPending_ = function(promise) {
var sentinel = {};
// eslint-disable-next-line compat/compat
return Promise.race([promise, Promise.resolve(sentinel)]).then(
function(result) {
return result === sentinel;
},
function() {
return false;
}
);
};
/**
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
* that will succeed if the actual value being compared is an instance of the specified class/constructor.