From cfb9478a43379d7c1dcd5556e7f99a6b0861f486 Mon Sep 17 00:00:00 2001 From: sigmaSd Date: Wed, 19 Jul 2023 00:24:30 +0100 Subject: fix(runtime): print process name in case of spawn error (#19855) Fix https://github.com/denoland/deno/issues/19400 Co-authored-by: David Sherret --- cli/tests/unit/command_test.ts | 16 ++++++++++++++++ 1 file changed, 16 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 2e73869a9..ce3af08fb 100644 --- a/cli/tests/unit/command_test.ts +++ b/cli/tests/unit/command_test.ts @@ -885,3 +885,19 @@ Deno.test( ); }, ); + +Deno.test( + "process that fails to spawn, prints its name in error", + async () => { + assertThrows( + () => new Deno.Command("doesntexist").outputSync(), + Error, + "Failed to spawn: doesntexist", + ); + await assertRejects( + async () => await new Deno.Command("doesntexist").output(), + Error, + "Failed to spawn: doesntexist", + ); + }, +); -- cgit v1.2.3