toMatchInlineSnapshot

Bun

Symbol

Matchers.toMatchInlineSnapshot

toMatchInlineSnapshot(value?: string): void

Asserts that a value matches the most recent inline snapshot.

@param value

The latest automatically-updated snapshot value.

expect("Hello").toMatchInlineSnapshot();
expect("Hello").toMatchInlineSnapshot(`"Hello"`);
toMatchInlineSnapshot(propertyMatchers?: object, value?: string): void

Asserts that a value matches the most recent inline snapshot.

@param propertyMatchers

Object containing properties to match against the value.

@param value

The latest automatically-updated snapshot value.

expect({ c: new Date() }).toMatchInlineSnapshot({ c: expect.any(Date) });
expect({ c: new Date() }).toMatchInlineSnapshot({ c: expect.any(Date) }, `
{
  "v": Any<Date>,
}
`);