.toBeNaN()

Use .toBeNaN when checking a value is NaN.

  1. test('passes when value is NaN', () => {
  2. expect(NaN).toBeNaN();
  3. expect(1).not.toBeNaN();
  4. });