mirror of
https://github.com/denoland/deno.git
synced 2024-11-01 09:24:20 -04:00
244926e83c
This commit changes "deno test" to better denote user output coming from test cases. This is done by printing "---- output ----" and "---- output end ----" markers if an output is produced. The output from "console" and "Deno.core.print" is captured, as well as direct writes to "Deno.stdout" and "Deno.stderr". To achieve that new APIs were added to "deno_core" crate, that allow to replace an existing resource with a different one (while keeping resource ids intact). Resources for stdout and stderr are replaced by pipes. Co-authored-by: David Sherret <dsherret@gmail.com>
15 lines
360 B
TypeScript
15 lines
360 B
TypeScript
Deno.test("description", async (t) => {
|
|
// the output is not great, but this is an extreme scenario
|
|
console.log(1);
|
|
await t.step("step 1", async (t) => {
|
|
console.log(2);
|
|
await t.step("inner 1", () => {
|
|
console.log(3);
|
|
});
|
|
await t.step("inner 2", () => {
|
|
console.log(4);
|
|
});
|
|
console.log(5);
|
|
});
|
|
console.log(6);
|
|
});
|