Skip to content
masterclass Buddy

Jest · Function

expect

expect(value) starts a Jest assertion. Chain a matcher such as toBe, toEqual, or toThrow to check the value produced by your code.

Last updated

Syntax

expect(value)

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

Subscribe
  • .not
  • .resolves
  • .rejects
  • .toBe
  • .toBeCloseTo
  • .toEqual
  • .toHaveBeenCalled
  • .toThrow

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