* Merges #2045 from @MattMcCherry
This commit is contained in:
Steve Gravrock
2024-12-12 17:29:27 -08:00
5 changed files with 120 additions and 0 deletions

View File

@@ -150,6 +150,7 @@ getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
'toBeTrue',
'toBeTruthy',
'toBeUndefined',
'toBeNullish',
'toContain',
'toEqual',
'toHaveSize',
@@ -6011,6 +6012,28 @@ getJasmineRequireObj().toBeNull = function() {
return toBeNull;
};
getJasmineRequireObj().toBeNullish = function() {
/**
* {@link expect} the actual value to be `null` or `undefined`.
* @function
* @name matchers#toBeNullish
* @since 5.6.0
* @example
* expect(result).toBeNullish():
*/
function toBeNullish() {
return {
compare: function(actual) {
return {
pass: null === actual || void 0 === actual
};
}
};
}
return toBeNullish;
};
getJasmineRequireObj().toBePositiveInfinity = function(j$) {
/**
* {@link expect} the actual value to be `Infinity` (infinity).