diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-03-04 22:05:44 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-04 16:35:44 +0000 |
commit | 5a28d70e05d9854102e983a4c4fd1cf4238361dc (patch) | |
tree | 0e040852085b0751c1eade3ba4c321d1b62e3017 /tests/unit_node/child_process_test.ts | |
parent | 66500199350fd9e7a32e6fc10855654ffac01c49 (diff) |
fix(node): errno property when command missing (#22691)
Fixes https://github.com/denoland/deno/issues/22604
`remix dev` with Node adapter works:
```
$ ~/gh/littledivy/deno/target/debug/deno task dev
Task dev remix dev --manual
💿 remix dev
info building...
info built (619ms)
[remix-serve] http://localhost:3000 (http://192.168.1.24:3000)
GET / 200 - - 3.090 ms
```
Diffstat (limited to 'tests/unit_node/child_process_test.ts')
-rw-r--r-- | tests/unit_node/child_process_test.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit_node/child_process_test.ts b/tests/unit_node/child_process_test.ts index 9c6fed9e4..85bb6d3b0 100644 --- a/tests/unit_node/child_process_test.ts +++ b/tests/unit_node/child_process_test.ts @@ -771,3 +771,15 @@ Deno.test(async function execFileWithUndefinedTimeout() { ); await promise; }); + +Deno.test(async function spawnCommandNotFoundErrno() { + const { promise, resolve } = Promise.withResolvers<void>(); + const cp = CP.spawn("no-such-command"); + cp.on("error", (err) => { + const errno = Deno.build.os === "windows" ? -4058 : -2; + // @ts-ignore: errno missing from typings + assertEquals(err.errno, errno); + resolve(); + }); + await promise; +}); |