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.
SubscribeRelated
expect.stringMatchingexpect.arrayContainingexpect.objectContainingtoEqual