From 2ba9ccc1ab25e5c631afcbb12b53f4545ca7f750 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Thu, 11 May 2023 13:53:45 +0100 Subject: fix(runtime): `ChildProcess::kill()` doesn't require additional perms (#15339) Fixes #15217. --- cli/tests/unit/command_test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cli/tests/unit/command_test.ts') 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.", + ); + }, +); -- cgit v1.2.3