Skip to content
masterclass Buddy

Jest · Matcher

toBeNull

toBeNull() checks that a value is exactly null. Use .not.toBeNull() to check that it is not null.

Last updated

Syntax

expect(value).toBeNull()

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

Subscribe
  • expect
  • not
  • toBeUndefined
  • toBeDefined
  • toBeTruthy
  • toBeFalsy

Source: Using Matchers · Jest. Checked 2026-11-03.