Vitest · Matcher
toMatchObject
toMatchObject checks whether an object contains a matching subset of properties. For arrays, it also requires the same number and order of elements.
Last updated
Syntax
(received: object | array) => Awaitable<void>In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
arrayContainingtoEqualtoStrictEqualexpect