Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions test/js/bun/test/snapshot-tests/snapshots/snapshot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -891,11 +891,16 @@ test("error snapshots", () => {
throw undefined; // this one doesn't work in jest because it doesn't think the function threw
}).toThrowErrorMatchingInlineSnapshot(`undefined`);
expect(() => {
expect(() => {}).toThrowErrorMatchingInlineSnapshot(`undefined`);
try {
expect(() => {}).toThrowErrorMatchingInlineSnapshot(`undefined`);
} catch (e) {
(e as Error).message = Bun.stripANSI((e as Error).message);
throw e;
}
}).toThrowErrorMatchingInlineSnapshot(`
"\x1B[2mexpect(\x1B[0m\x1B[31mreceived\x1B[0m\x1B[2m).\x1B[0mtoThrowErrorMatchingInlineSnapshot\x1B[2m(\x1B[0m\x1B[2m)\x1B[0m
"expect(received).toThrowErrorMatchingInlineSnapshot()

\x1B[1mMatcher error\x1B[0m: Received function did not throw
Matcher error: Received function did not throw
"
`);
});
Expand Down