Skip to content
masterclass Buddy

Jest · Matcher

toBeNaN

toBeNaN checks whether a value is NaN. Prefix it with .not to check that a value is not NaN.

Last updated

Syntax

expect(value).toBeNaN() | expect(value).not.toBeNaN()

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • expect
  • not
  • toBe
  • toBeFalsy
  • toBeTruthy

Source: Expect · Jest. Checked 2026-11-03.