Skip to content
masterclass Buddy

Jest · Function

toMatchSnapshot

toMatchSnapshot compares a value with a stored Jest snapshot. Property matchers let generated fields, such as dates and IDs, vary without breaking the test.

Last updated

Syntax

expect(value).toMatchSnapshot(propertyMatchers?)

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

Subscribe
  • Snapshot Testing
  • Updating Snapshots
  • Inline Snapshots
  • Property Matchers
  • Interactive Snapshot Mode

Source: Snapshot Testing · Jest. Checked 2026-11-03.