mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 13:22:07 +00:00
fix
This commit is contained in:
@@ -17,3 +17,27 @@ test("resolves not toThrow", async () => {
|
||||
await expect(Promise.resolve(new Error("abc"))).resolves.toThrow("abc");
|
||||
await expect(Promise.reject(new Error("abc"))).rejects.toThrow("abc");
|
||||
});
|
||||
|
||||
test("doesn't break rejects", () => {
|
||||
expect(
|
||||
(async () => {
|
||||
throw new DOMException("123");
|
||||
})(),
|
||||
).rejects.toThrow("123");
|
||||
});
|
||||
|
||||
test("doesn't break rejects null", () => {
|
||||
expect(
|
||||
(async () => {
|
||||
throw null;
|
||||
})(),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
|
||||
test("resolves null doesn't throw", () => {
|
||||
expect(
|
||||
(async () => {
|
||||
return null;
|
||||
})(),
|
||||
).resolves.not.toThrow();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user