From 5c349039b8257fe6a5d8aa2fda91d54f3358bd7a Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Mon, 22 May 2023 09:54:58 -0600 Subject: [PATCH] chore(cli): Don't assume deno is in path for spawn_kill_permissions (#19198) We don't need to use the `deno` command here to test kill permissions and it's awkward to get right without passing `-A`. `cat` works, but for platforms other than windows. This test should have plenty of coverage on other platforms. --- cli/tests/integration/run_tests.rs | 3 ++- cli/tests/testdata/spawn_kill_permissions.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index bc717351a0..eecf8537f0 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -3434,8 +3434,9 @@ itest!(test_and_bench_are_noops_in_run { output_str: Some(""), }); +#[cfg(not(target_os = "windows"))] itest!(spawn_kill_permissions { - args: "run --quiet --unstable --allow-run=deno spawn_kill_permissions.ts", + args: "run --quiet --unstable --allow-run=cat spawn_kill_permissions.ts", output_str: Some(""), }); diff --git a/cli/tests/testdata/spawn_kill_permissions.ts b/cli/tests/testdata/spawn_kill_permissions.ts index e0c1b7bfdb..86626bd5cf 100644 --- a/cli/tests/testdata/spawn_kill_permissions.ts +++ b/cli/tests/testdata/spawn_kill_permissions.ts @@ -1,5 +1,5 @@ -const child = new Deno.Command("deno", { - args: ["eval", "await new Promise(r => setTimeout(r, 2000))"], +const child = new Deno.Command("cat", { + args: ["-"], stdout: "null", stderr: "null", }).spawn();