toBeNaN

Bun

Symbol

Matchers.toBeNaN

toBeNaN(): void

Asserts that a value is NaN.

Same as using Number.isNaN().

expect(NaN).toBeNaN();
expect(Infinity).toBeNaN(); // fail
expect("notanumber").toBeNaN(); // fail