Skip to content
masterclass Buddy

Jest · Matcher

toBeTruthy

toBeTruthy() checks that a value behaves like true in a JavaScript boolean context. Use it when the exact value is not important.

Last updated

Syntax

expect(value).toBeTruthy()

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

Subscribe
  • toBeFalsy()
  • toBeDefined()
  • toBeUndefined()
  • toBeNull()
  • toBe()
  • expect(value)

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