deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

`[child_process spawn] 'spawn' event` test uses "echo" which is not available on windows

Open dsherret opened this issue 3 years ago • 5 comments

This test uses "echo", but that's not available on Windows except when executing through cmd:

{
  "0": NotFound: program not found
    at Object.opSync (deno:core/01_core.js:177:12)
    at opRun (deno:runtime/js/40_process.js:29:17)
    at Object.run (deno:runtime/js/40_process.js:116:17)
    at new ChildProcess (file:///V:/deno_std/node/internal/child_process.ts:137:28)
    at spawn (file:///V:/deno_std/node/child_process.ts:122:10)
    at file:///V:/deno_std/node/child_process_test.ts:176:22
    at testStepSanitizer (deno:runtime/js/40_testing.js:444:13)
    at asyncOpSanitizer (deno:runtime/js/40_testing.js:145:15)
    at resourceSanitizer (deno:runtime/js/40_testing.js:370:13)
    at Object.exitSanitizer [as fn] (deno:runtime/js/40_testing.js:427:15)
}

dsherret avatar Apr 07 '22 14:04 dsherret

Looking at it right now.

luk3skyw4lker avatar Apr 09 '22 13:04 luk3skyw4lker

Another tests on the same file also use echo, would it be the case to refactor them all or just this one?

luk3skyw4lker avatar Apr 09 '22 14:04 luk3skyw4lker

Thanks for looking into it. I think only that test. The other one is ignored on Windows and the other one uses a shell.

dsherret avatar Apr 09 '22 17:04 dsherret

You're welcome, I'll try to open a PR for solving this still today. I'm looking out for probable replacements for echo if it's a windows environment.

luk3skyw4lker avatar Apr 09 '22 18:04 luk3skyw4lker

One last thing, in which case that error is thrown? Because as far as I know, echo is really a command in the windows CMD, but you made it look like you weren't in a cmd environment when describing the issue, could you clarify it for me?

luk3skyw4lker avatar Apr 09 '22 18:04 luk3skyw4lker

@kt3k, I believe this can be closed as #2353 has implemented this fix.

iuioiua avatar Sep 08 '22 05:09 iuioiua

@iuioiua Thanks!

kt3k avatar Sep 08 '22 05:09 kt3k