Use .toBeNaN when checking a value is NaN.
.toBeNaN
NaN
test('passes when value is NaN', () => { expect(NaN).toBeNaN(); expect(1).not.toBeNaN(); });