From cadeaae045d2489fe125286b8c2c641c6d973c3f Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Tue, 24 Jan 2023 15:03:46 +0100 Subject: feat(runtime/command): make stdin default to inherit for spawn() (#17334) Closes #17230 --- cli/tests/unit/command_test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cli/tests') diff --git a/cli/tests/unit/command_test.ts b/cli/tests/unit/command_test.ts index e7f940535..b9fa8295b 100644 --- a/cli/tests/unit/command_test.ts +++ b/cli/tests/unit/command_test.ts @@ -83,6 +83,24 @@ Deno.test( }, ); +Deno.test( + { permissions: { run: true, read: true } }, + async function commandStdinPiped() { + const command = new Deno.Command(Deno.execPath(), { + args: ["info"], + stdout: "null", + stderr: "null", + }); + const child = command.spawn(); + + assertThrows(() => child.stdin, TypeError, "stdin is not piped"); + assertThrows(() => child.stdout, TypeError, "stdout is not piped"); + assertThrows(() => child.stderr, TypeError, "stderr is not piped"); + + await child.status; + }, +); + Deno.test( { permissions: { run: true, read: true } }, async function commandStdoutPiped() { -- cgit v1.2.3