toThrowErrorMatchingInlineSnapshot

Bun

Symbol

Matchers.toThrowErrorMatchingInlineSnapshot

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!"`);