diff options
Diffstat (limited to 'cli/tests/unit/command_test.ts')
-rw-r--r-- | cli/tests/unit/command_test.ts | 18 |
1 files changed, 18 insertions, 0 deletions
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 @@ -85,6 +85,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() { const command = new Deno.Command(Deno.execPath(), { args: [ |