mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
28 lines
726 B
TypeScript
28 lines
726 B
TypeScript
|
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.");
|
||
|
});
|
||
|
});
|
||
|
});
|