Files
jasmine/spec/core/matchers/toBeNaNSpec.js
Sheel Choksi b6c03a34e7 Use default failure message for toBeNaN
It is providing the same functionality by default without a custom error message
2014-02-17 22:45:54 -08:00

30 lines
712 B
JavaScript

describe("toBeNaN", function() {
it("passes for NaN", function() {
var matcher = j$.matchers.toBeNaN(),
result;
result = matcher.compare(Number.NaN);
expect(result.pass).toBe(true);
});
it("fails for anything not a NaN", function() {
var matcher = j$.matchers.toBeNaN(),
result;
result = matcher.compare(1);
expect(result.pass).toBe(false);
result = matcher.compare(null);
expect(result.pass).toBe(false);
result = matcher.compare(void 0);
expect(result.pass).toBe(false);
result = matcher.compare('');
expect(result.pass).toBe(false);
result = matcher.compare(Number.POSITIVE_INFINITY);
expect(result.pass).toBe(false);
});
});