Skip to content
masterclass Buddy

Jest · Matcher

toContainEqual

toContainEqual checks that an array contains an item with matching structure and values. It compares fields recursively instead of requiring the same object reference.

Last updated

Syntax

expect(received).toContainEqual(item)

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

Subscribe
  • toContain
  • toEqual
  • toStrictEqual
  • expect(value)

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