Skip to content

test: fix test-child-process-flush-stdio on windows (Node V4 only)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change

Ref: https://github.com/nodejs/node/pull/7049

When https://github.com/nodejs/node/commit/65b5cccee90885dc468f67d08affa6cebd84234f landed in V4, the fix didn't work there - it relies on the V6 "shell:true" option on child_process.spawn() that was added after V4, therefore the test failes when there is no "echo.exe" on Windows systems. This fix implements the same functionality (cmd/c echo) that the shell:true option would have given.

The "shell" option was added in https://github.com/nodejs/node/commit/c3bb4b1aa5e907d489619fb43d233c3336bfc03d and I'm assuming we have no desire to land that option back in V4 just to fix the test case, so I am adjusting the test.

FYA: @TheAlphaNerd @mscdex

Merge request reports

Loading