diff options
Diffstat (limited to 'tests/specs/run/complex_error')
-rw-r--r-- | tests/specs/run/complex_error/__test__.jsonc | 5 | ||||
-rw-r--r-- | tests/specs/run/complex_error/complex_error.ts | 18 | ||||
-rw-r--r-- | tests/specs/run/complex_error/complex_error.ts.out | 44 |
3 files changed, 67 insertions, 0 deletions
diff --git a/tests/specs/run/complex_error/__test__.jsonc b/tests/specs/run/complex_error/__test__.jsonc new file mode 100644 index 000000000..2f7274be4 --- /dev/null +++ b/tests/specs/run/complex_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet complex_error.ts", + "output": "complex_error.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/complex_error/complex_error.ts b/tests/specs/run/complex_error/complex_error.ts new file mode 100644 index 000000000..b462992ac --- /dev/null +++ b/tests/specs/run/complex_error/complex_error.ts @@ -0,0 +1,18 @@ +const error = new AggregateError( + [ + new AggregateError([new Error("qux1"), new Error("quux1")]), + new Error("bar1", { cause: new Error("baz1") }), + ], + "foo1", + { + cause: new AggregateError([ + new AggregateError([new Error("qux2"), new Error("quux2")]), + new Error("bar2", { cause: new Error("baz2") }), + ], "foo2"), + }, +); +console.log(error.stack); +console.log(); +console.log(error); +console.log(); +throw error; diff --git a/tests/specs/run/complex_error/complex_error.ts.out b/tests/specs/run/complex_error/complex_error.ts.out new file mode 100644 index 000000000..3c3c26eaf --- /dev/null +++ b/tests/specs/run/complex_error/complex_error.ts.out @@ -0,0 +1,44 @@ +AggregateError: foo1 + at [WILDCARD]/complex_error.ts:1:15 + +AggregateError: foo1 + AggregateError + Error: qux1 + at [WILDCARD]/complex_error.ts:3:25 + Error: quux1 + at [WILDCARD]/complex_error.ts:3:44 + at [WILDCARD]/complex_error.ts:3:5 + Error: bar1 + at [WILDCARD]/complex_error.ts:4:5 + Caused by Error: baz1 + at [WILDCARD]/complex_error.ts:4:32 + at [WILDCARD]/complex_error.ts:1:15 +Caused by AggregateError: foo2 + at [WILDCARD]/complex_error.ts:8:12 + +error: Uncaught (in promise) AggregateError: foo1 + AggregateError + Error: qux1 + at [WILDCARD]/complex_error.ts:3:25 + Error: quux1 + at [WILDCARD]/complex_error.ts:3:44 + at [WILDCARD]/complex_error.ts:3:5 + Error: bar1 + at [WILDCARD]/complex_error.ts:4:5 + Caused by: Error: baz1 + at [WILDCARD]/complex_error.ts:4:32 +const error = new AggregateError( + ^ + at [WILDCARD]/complex_error.ts:1:15 +Caused by: AggregateError: foo2 + AggregateError + Error: qux2 + at [WILDCARD]/complex_error.ts:9:27 + Error: quux2 + at [WILDCARD]/complex_error.ts:9:46 + at [WILDCARD]/complex_error.ts:9:7 + Error: bar2 + at [WILDCARD]/complex_error.ts:10:7 + Caused by: Error: baz2 + at [WILDCARD]/complex_error.ts:10:34 + at [WILDCARD]/complex_error.ts:8:12 |