Asserts that a value matches the most recent snapshot.
Symbol
MatchersBuiltin.toMatchSnapshot
@param hint
Hint used to identify the snapshot in the snapshot file.
expect([1, 2, 3]).toMatchSnapshot('hint message');
Asserts that a value matches the most recent snapshot.
@param propertyMatchers
Object containing properties to match against the value.
@param hint
Hint used to identify the snapshot in the snapshot file.
expect([1, 2, 3]).toMatchSnapshot();
expect({ a: 1, b: 2 }).toMatchSnapshot({ a: 1 });
expect({ c: new Date() }).toMatchSnapshot({ c: expect.any(Date) });