Skip to content

Commit 529e4f2

Browse files
committed
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: #12945 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 1541079 commit 529e4f2

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

test/parallel/test-spawn-cmd-named-pipe.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,10 @@ if (!process.argv[2]) {
3737
});
3838
stdoutPipeServer.listen(stdoutPipeName);
3939

40-
const comspec = process.env['comspec'];
41-
if (!comspec || comspec.length === 0) {
42-
assert.fail('Failed to get COMSPEC');
43-
}
40+
const args =
41+
[`"${__filename}"`, 'child', '<', stdinPipeName, '>', stdoutPipeName];
4442

45-
const args = ['/c', process.execPath, __filename, 'child',
46-
'<', stdinPipeName, '>', stdoutPipeName];
47-
48-
const child = spawn(comspec, args);
43+
const child = spawn(`"${process.execPath}"`, args, { shell: true });
4944

5045
child.on('exit', common.mustCall(function(exitCode) {
5146
stdinPipeServer.close();

0 commit comments

Comments
 (0)