mirror of
https://github.com/denoland/deno.git
synced 2025-01-22 06:09:25 -05:00
test(cli): ensure await all on stdout does not deadlock (#8802)
This commit is contained in:
parent
8252937370
commit
55dc467b41
3 changed files with 16 additions and 0 deletions
|
@ -2105,6 +2105,11 @@ fn deno_test_no_color() {
|
|||
assert!(out.contains("test result: FAILED. 1 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out"));
|
||||
}
|
||||
|
||||
itest!(stdout_write_all {
|
||||
args: "run --quiet stdout_write_all.ts",
|
||||
output: "stdout_write_all.out",
|
||||
});
|
||||
|
||||
itest!(_001_hello {
|
||||
args: "run --reload 001_hello.js",
|
||||
output: "001_hello.js.out",
|
||||
|
|
3
cli/tests/stdout_write_all.out
Normal file
3
cli/tests/stdout_write_all.out
Normal file
|
@ -0,0 +1,3 @@
|
|||
done
|
||||
done
|
||||
complete
|
8
cli/tests/stdout_write_all.ts
Normal file
8
cli/tests/stdout_write_all.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
const encoder = new TextEncoder();
|
||||
const pending = [
|
||||
Deno.stdout.write(encoder.encode("done\n")),
|
||||
Deno.stdout.write(encoder.encode("done\n")),
|
||||
];
|
||||
|
||||
await Promise.all(pending);
|
||||
await Deno.stdout.write(encoder.encode("complete\n"));
|
Loading…
Add table
Reference in a new issue