Skip to content
masterclass Buddy

Jest · Function

toEqual

toEqual compares object and array contents recursively. Use it when values should have the same data, even if they are different object instances.

Last updated

Syntax

expect(value).toEqual(expected)

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

Subscribe
  • expect
  • toBe
  • toStrictEqual
  • not

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