summaryrefslogtreecommitdiff
path: root/cli/tests/unit/command_test.ts
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2023-01-24 15:03:46 +0100
committerGitHub <noreply@github.com>2023-01-24 15:03:46 +0100
commitcadeaae045d2489fe125286b8c2c641c6d973c3f (patch)
treeff98b976cfa25fe3d85201d01a290334a0472f12 /cli/tests/unit/command_test.ts
parent654e177c919babe4eef4c1c9545ef267b23884e6 (diff)
feat(runtime/command): make stdin default to inherit for spawn() (#17334)
Closes #17230
Diffstat (limited to 'cli/tests/unit/command_test.ts')
-rw-r--r--cli/tests/unit/command_test.ts18
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: [