test: make a test path-independent

parallel/test-spawn-cmd-named-pipe.js failed with spaces
both in node.exe and test paths.

PR-URL: https://github.com/nodejs/node/pull/12945
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Vse Mozhet Byt 2017-05-10 07:53:18 +03:00
parent 15410797f2
commit 529e4f206a

View File

@ -37,15 +37,10 @@ if (!process.argv[2]) {
});
stdoutPipeServer.listen(stdoutPipeName);
const comspec = process.env['comspec'];
if (!comspec || comspec.length === 0) {
assert.fail('Failed to get COMSPEC');
}
const args =
[`"${__filename}"`, 'child', '<', stdinPipeName, '>', stdoutPipeName];
const args = ['/c', process.execPath, __filename, 'child',
'<', stdinPipeName, '>', stdoutPipeName];
const child = spawn(comspec, args);
const child = spawn(`"${process.execPath}"`, args, { shell: true });
child.on('exit', common.mustCall(function(exitCode) {
stdinPipeServer.close();