diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 2f23e2dee6..302e808faf 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -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", diff --git a/cli/tests/stdout_write_all.out b/cli/tests/stdout_write_all.out new file mode 100644 index 0000000000..49a6d64e94 --- /dev/null +++ b/cli/tests/stdout_write_all.out @@ -0,0 +1,3 @@ +done +done +complete diff --git a/cli/tests/stdout_write_all.ts b/cli/tests/stdout_write_all.ts new file mode 100644 index 0000000000..c82a0ca7d1 --- /dev/null +++ b/cli/tests/stdout_write_all.ts @@ -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"));