to be NaN

  • <number> [not] to be NaN

Asserts that the value is NaN.

expect(NaN, 'to be NaN');

In case of a failing expectation you get the following output:

expect(2, 'to be NaN');
expected 2 to be NaN

This assertion can be negated using the not flag:

expect(2, 'not to be NaN');

In case of a failing expectation you get the following output:

expect(NaN, 'not to be NaN');
expected NaN not to be NaN