MtoThrowErrorMatchingInlineSnapshot
Bun

method

test.MatchersBuiltin.toThrowErrorMatchingInlineSnapshot

value?: string
): void;

Asserts that a function throws an error matching the most recent snapshot.

@param value

The latest automatically-updated snapshot value.

function fail() {
  throw new Error("Oops!");
}
expect(fail).toThrowErrorMatchingInlineSnapshot();
expect(fail).toThrowErrorMatchingInlineSnapshot(`"Oops!"`);