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.
SubscribeRelated
Snapshot TestingUpdating SnapshotsInline SnapshotsProperty MatchersInteractive Snapshot Mode