summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-11-10 06:59:39 +0100
committerGitHub <noreply@github.com>2023-11-10 05:59:39 +0000
commit612b7dfcc76278f7823b2ea09540922955ac8bf5 (patch)
treef23fcc736f51baf7178ddc9476f379858c3c7f06 /cli/tests
parent9010b8df53cd37f0410e08c43a194667974686a2 (diff)
fix(node/child_process): properly normalize stdio for 'spawnSync' (#21103)
Closes https://github.com/denoland/deno/issues/20782
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/unit_node/child_process_test.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/tests/unit_node/child_process_test.ts b/cli/tests/unit_node/child_process_test.ts
index 8d1c9a6b7..47e87096e 100644
--- a/cli/tests/unit_node/child_process_test.ts
+++ b/cli/tests/unit_node/child_process_test.ts
@@ -707,3 +707,17 @@ Deno.test(function spawnSyncUndefinedValueInEnvVar() {
assertEquals(ret.status, 0);
assertEquals(ret.stdout.toString("utf-8").trim(), "BAZ");
});
+
+Deno.test(function spawnSyncStdioUndefined() {
+ const ret = spawnSync(
+ `"${Deno.execPath()}" eval "console.log('hello');console.error('world')"`,
+ {
+ stdio: [undefined, undefined, undefined],
+ shell: true,
+ },
+ );
+
+ assertEquals(ret.status, 0);
+ assertEquals(ret.stdout.toString("utf-8").trim(), "hello");
+ assertEquals(ret.stderr.toString("utf-8").trim(), "world");
+});