diff options
Diffstat (limited to 'tests/specs/test/parallel_output')
| -rw-r--r-- | tests/specs/test/parallel_output/__test__.jsonc | 5 | ||||
| -rw-r--r-- | tests/specs/test/parallel_output/main.out | 56 | ||||
| -rw-r--r-- | tests/specs/test/parallel_output/main.ts | 27 |
3 files changed, 88 insertions, 0 deletions
diff --git a/tests/specs/test/parallel_output/__test__.jsonc b/tests/specs/test/parallel_output/__test__.jsonc new file mode 100644 index 000000000..dde5a1c6f --- /dev/null +++ b/tests/specs/test/parallel_output/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "test --parallel --reload main.ts", + "exitCode": 1, + "output": "main.out" +} diff --git a/tests/specs/test/parallel_output/main.out b/tests/specs/test/parallel_output/main.out new file mode 100644 index 000000000..3d020a71f --- /dev/null +++ b/tests/specs/test/parallel_output/main.out @@ -0,0 +1,56 @@ +Check [WILDCARD]/main.ts +./main.ts => step output ... step 1 ... ok ([WILDCARD]s) +./main.ts => step output ... step 2 ... ok ([WILDCARD]s) +------- output ------- +Hello, world! (from step 3) +----- output end ----- +./main.ts => step output ... step 3 ... ok ([WILDCARD]s) +------- output ------- +Hello, world! (from step 4) +----- output end ----- +./main.ts => step output ... step 4 ... ok ([WILDCARD]s) +./main.ts => step output ... ok ([WILDCARD]s) +./main.ts => step failures ... step 1 ... ok ([WILDCARD]s) +./main.ts => step failures ... step 2 ... FAILED ([WILDCARD]s) +./main.ts => step failures ... step 3 ... FAILED ([WILDCARD]s) +./main.ts => step failures ... FAILED (due to 2 failed steps) ([WILDCARD]s) +./main.ts => step nested failure ... step 1 ... inner 1 ... ok ([WILDCARD]s) +./main.ts => step nested failure ... step 1 ... inner 2 ... FAILED ([WILDCARD]s) +./main.ts => step nested failure ... step 1 ... FAILED (due to 1 failed step) ([WILDCARD]s) +./main.ts => step nested failure ... FAILED (due to 1 failed step) ([WILDCARD]s) + + ERRORS + +step failures ... step 2 => ./main.ts:14:11 +error: Error: Fail. + throw new Error("Fail."); + ^ + at file:///[WILDCARD]/main.ts:15:11 + at [WILDCARD] + at file:///[WILDCARD]/main.ts:14:11 + +step failures ... step 3 => ./main.ts:17:11 +error: Error: Fail. + await t.step("step 3", () => Promise.reject(new Error("Fail."))); + ^ + at file:///[WILDCARD]/main.ts:17:47 + at [WILDCARD] + at file:///[WILDCARD]/main.ts:17:11 + +step nested failure ... step 1 ... inner 2 => ./main.ts:23:13 +error: Error: Failed. + throw new Error("Failed."); + ^ + at file:///[WILDCARD]/main.ts:24:13 + at [WILDCARD] + at file:///[WILDCARD]/main.ts:23:13 + + FAILURES + +step failures ... step 2 => ./main.ts:14:11 +step failures ... step 3 => ./main.ts:17:11 +step nested failure ... step 1 ... inner 2 => ./main.ts:23:13 + +FAILED | 1 passed (6 steps) | 2 failed (4 steps) ([WILDCARD]s) + +error: Test failed diff --git a/tests/specs/test/parallel_output/main.ts b/tests/specs/test/parallel_output/main.ts new file mode 100644 index 000000000..5de733aad --- /dev/null +++ b/tests/specs/test/parallel_output/main.ts @@ -0,0 +1,27 @@ +Deno.test("step output", async (t) => { + await t.step("step 1", () => {}); + await t.step("step 2", () => {}); + await t.step("step 3", () => { + console.log("Hello, world! (from step 3)"); + }); + await t.step("step 4", () => { + console.log("Hello, world! (from step 4)"); + }); +}); + +Deno.test("step failures", async (t) => { + await t.step("step 1", () => {}); + await t.step("step 2", () => { + throw new Error("Fail."); + }); + await t.step("step 3", () => Promise.reject(new Error("Fail."))); +}); + +Deno.test("step nested failure", async (t) => { + await t.step("step 1", async (t) => { + await t.step("inner 1", () => {}); + await t.step("inner 2", () => { + throw new Error("Failed."); + }); + }); +}); |
