Vitest · Matcher
toMatchSnapshot
toMatchSnapshot checks a value against a stored Vitest snapshot. It creates the snapshot on the first run and fails later when the serialized output changes.
Last updated
Syntax
toMatchSnapshot<T>(shape?: Partial<T> | string, hint?: string): voidIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expecttoMatchInlineSnapshottoMatchFileSnapshottoThrowErrorMatchingSnapshottoThrowErrorMatchingInlineSnapshotsnapshotFormatsnapshotSerializers