Skip to content
masterclass Buddy

Jest · Matcher

toMatchObject

toMatchObject checks selected properties of an object. Extra properties are allowed; for arrays, corresponding objects must match and the array lengths must be equal.

Last updated

Syntax

expect(received).toMatchObject(object)

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

Subscribe
  • expect.stringMatching
  • expect.arrayContaining
  • expect.objectContaining
  • toEqual

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