summaryrefslogtreecommitdiff
path: root/tests/specs/test/parallel_output/main.ts
blob: 5de733aad083758216c0eeb37dd76b2fb8f46c8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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.");
    });
  });
});