From 89f0b796bd442ff352c3f93f69156ca6d85bfd5e Mon Sep 17 00:00:00 2001 From: Mohammad Sulaiman Date: Tue, 5 Nov 2024 08:39:05 +0200 Subject: chore: deprecate run itests (#26444) --- tests/specs/run/complex_error/__test__.jsonc | 5 +++ tests/specs/run/complex_error/complex_error.ts | 18 +++++++++ tests/specs/run/complex_error/complex_error.ts.out | 44 ++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 tests/specs/run/complex_error/__test__.jsonc create mode 100644 tests/specs/run/complex_error/complex_error.ts create mode 100644 tests/specs/run/complex_error/complex_error.ts.out (limited to 'tests/specs/run/complex_error') 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 -- cgit v1.2.3