Skip to content
masterclass Buddy

Vitest · Matcher

toMatchInlineSnapshot

toMatchInlineSnapshot checks a value against a snapshot written inside the test file. Vitest creates or updates that string, and the test fails when the value differs.

Last updated

Syntax

toMatchInlineSnapshot(shape?: Partial<T> | string, snapshot?: string, hint?: string) => void

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

Subscribe
  • toMatchSnapshot
  • toMatchFileSnapshot
  • toThrowErrorMatchingSnapshot
  • toThrowErrorMatchingInlineSnapshot
  • expect.any
  • snapshotFormat

Source: expect | Vitest. Checked 2026-11-03.