This commit is contained in:
pfg
2025-07-31 17:59:19 -07:00
parent 5277d38423
commit 0800a4cee5
2 changed files with 34 additions and 6 deletions

View File

@@ -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();
});