diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-08-15 09:38:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-15 09:38:46 -0700 |
commit | 8749d651fb5e0964cdb8e62be7a59a603cbc3c7c (patch) | |
tree | 1506d08504561a4013ad03ff1068bec23e572102 /tests/specs/node/child_process_extra_pipes/main.ts | |
parent | 7ca95fc999f22cb0eb312e02f8c40d7589b35b7e (diff) |
fix(node): Create additional pipes for child processes (#25016)
Linux/macos only currently.
Part of https://github.com/denoland/deno/issues/23524 (fixes it on
platforms other than windows).
Part of #16899 (fixes it on platforms other than windows).
After this PR, playwright is functional on mac/linux.
Diffstat (limited to 'tests/specs/node/child_process_extra_pipes/main.ts')
-rw-r--r-- | tests/specs/node/child_process_extra_pipes/main.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/specs/node/child_process_extra_pipes/main.ts b/tests/specs/node/child_process_extra_pipes/main.ts new file mode 100644 index 000000000..a3683fe9e --- /dev/null +++ b/tests/specs/node/child_process_extra_pipes/main.ts @@ -0,0 +1,26 @@ +import child_process from "node:child_process"; +import { Buffer } from "node:buffer"; +import console from "node:console"; + +const child = child_process.spawn("./test-pipe/target/debug/test-pipe", [], { + stdio: ["inherit", "inherit", "inherit", "ignore", "pipe"], +}); + +const extra = child.stdio[4]; + +const p = Promise.withResolvers(); + +child.on("close", () => { + console.log("child closed"); + p.resolve(); +}); + +extra.on("data", (d) => { + console.log("data:", d.toString().trim()); +}); + +extra.on("close", () => { + console.log("pipe closed"); +}); + +await p.promise; |