summaryrefslogtreecommitdiff
path: root/cli/tests/unit/command_test.ts
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2023-05-11 13:53:45 +0100
committerGitHub <noreply@github.com>2023-05-11 14:53:45 +0200
commit2ba9ccc1ab25e5c631afcbb12b53f4545ca7f750 (patch)
tree38edbbacb6682b178e0356bf38fbb1f91cc5fe93 /cli/tests/unit/command_test.ts
parent20c42286f88d861192f35d272a645d8ab6f15be8 (diff)
fix(runtime): `ChildProcess::kill()` doesn't require additional perms (#15339)
Fixes #15217.
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 0763a7ac6..198f94aed 100644
--- a/cli/tests/unit/command_test.ts
+++ b/cli/tests/unit/command_test.ts
@@ -867,3 +867,21 @@ Deno.test(
}
},
);
+
+Deno.test(
+ { permissions: { run: true, read: true } },
+ async function commandKillAfterStatus() {
+ const command = new Deno.Command(Deno.execPath(), {
+ args: ["help"],
+ stdout: "null",
+ stderr: "null",
+ });
+ const child = command.spawn();
+ await child.status;
+ assertThrows(
+ () => child.kill(),
+ TypeError,
+ "Child process has already terminated.",
+ );
+ },
+);