From 529e4f206aa16e53e19a6f03b3bfc5f07268149e Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Wed, 10 May 2017 07:53:18 +0300 Subject: [PATCH] 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 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- test/parallel/test-spawn-cmd-named-pipe.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-spawn-cmd-named-pipe.js b/test/parallel/test-spawn-cmd-named-pipe.js index 3843ba1f77e624..94a34b640d1e3c 100644 --- a/test/parallel/test-spawn-cmd-named-pipe.js +++ b/test/parallel/test-spawn-cmd-named-pipe.js @@ -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();