Vitest · Matcher
toMatchFileSnapshot
toMatchSnapshot checks a value against a saved Vitest snapshot. It creates the snapshot on the first run and fails when later output differs.
Last updated
Syntax
expect(received).toMatchSnapshot(hint?: string)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
toMatchInlineSnapshottoThrowErrorMatchingSnapshottoThrowErrorMatchingInlineSnapshottoMatchFileSnapshottoMatchAriaSnapshottoMatchScreenshot