Skip to content
masterclass Buddy

Jest · Matcher

toBe

toBe checks whether a value is exactly equal to an expected value. It is Jest's basic exact-equality matcher.

Last updated

Syntax

expect(actual).toBe(expected)

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

Subscribe
  • expect
  • toEqual
  • toStrictEqual
  • not
  • toBeCloseTo

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