diff options
author | sigmaSd <bedisnbiba@gmail.com> | 2023-07-19 00:24:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-19 01:24:30 +0200 |
commit | cfb9478a43379d7c1dcd5556e7f99a6b0861f486 (patch) | |
tree | 71ebcf0d1e8e08f449a3417dbcc73d56b3a07630 /cli/tests/unit/command_test.ts | |
parent | bab0294db674c64c18243a877e9dff5f9a91c923 (diff) |
fix(runtime): print process name in case of spawn error (#19855)
Fix https://github.com/denoland/deno/issues/19400
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
Diffstat (limited to 'cli/tests/unit/command_test.ts')
-rw-r--r-- | cli/tests/unit/command_test.ts | 16 |
1 files changed, 16 insertions, 0 deletions
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", + ); + }, +); |