* Top level private APIs (e.g. jasmine.private.whatever) are no longer exposed * jasmineRequire is no longer exposed * core is self-booting * Globals are automatically created in browsers. (They can subsequently be removed by user code if desired.) * Globals are *not* automatically created in Node. An installGlobals function is exported instead. The jasmine package calls installGlobals unless configured not to do so. * In Node, the same instance is returned each time jasmine-core is imported. A reset function is exported. It effectively resets all state by discarding the env and creating a new one. This allows mulitple sequential runs within the same process to be independent of each other, but does not allow multiple concurrent runs. (That probably never worked anyway.) Fixes #2094
34 lines
717 B
JavaScript
34 lines
717 B
JavaScript
getJasmineRequireObj().toBeNaN = function(j$, private$) {
|
|
'use strict';
|
|
|
|
/**
|
|
* {@link expect} the actual value to be `NaN` (Not a Number).
|
|
* @function
|
|
* @name matchers#toBeNaN
|
|
* @since 1.3.0
|
|
* @example
|
|
* expect(thing).toBeNaN();
|
|
*/
|
|
function toBeNaN(matchersUtil) {
|
|
return {
|
|
compare: function(actual) {
|
|
const result = {
|
|
pass: actual !== actual
|
|
};
|
|
|
|
if (result.pass) {
|
|
result.message = 'Expected actual not to be NaN.';
|
|
} else {
|
|
result.message = function() {
|
|
return 'Expected ' + matchersUtil.pp(actual) + ' to be NaN.';
|
|
};
|
|
}
|
|
|
|
return result;
|
|
}
|
|
};
|
|
}
|
|
|
|
return toBeNaN;
|
|
};
|