aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-vscode/example/example.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/bun-vscode/example/example.test.ts')
-rw-r--r--packages/bun-vscode/example/example.test.ts19
1 files changed, 18 insertions, 1 deletions
diff --git a/packages/bun-vscode/example/example.test.ts b/packages/bun-vscode/example/example.test.ts
index a9da929eb..8e855745c 100644
--- a/packages/bun-vscode/example/example.test.ts
+++ b/packages/bun-vscode/example/example.test.ts
@@ -5,7 +5,24 @@ describe("example", () => {
expect(1).toBe(1);
expect(1).not.toBe(2);
expect(() => {
- throw new Error("error");
+ throw new TypeError("Oops! I did it again.");
+ }).toThrow();
+ expect(() => {
+ throw new Error("Parent error.", {
+ cause: new TypeError("Child error."),
+ });
+ }).toThrow();
+ expect(() => {
+ throw new AggregateError([new TypeError("Child error 1."), new TypeError("Child error 2.")], "Parent error.");
+ }).toThrow();
+ expect(() => {
+ throw "This is a string error";
+ }).toThrow();
+ expect(() => {
+ throw {
+ message: "This is an object error",
+ code: -1021,
+ };
}).toThrow();
});
});