From b479f5af800a43b63c07cef572cb8511a9d8384a Mon Sep 17 00:00:00 2001 From: briete Date: Fri, 3 Aug 2018 15:00:36 +0900 Subject: [PATCH] test: fix a problem that the test fails at the windows7 command prompt When testing with 'cmd.exe' of Windows 7, 'spawn cat ENOENT' error has occurred. Since the standard 'cmd.exe' has no 'cat' command, Instead will use the 'type' command --- test/parallel/test-http-chunk-problem.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-http-chunk-problem.js b/test/parallel/test-http-chunk-problem.js index f999f055fc0a91..a6e78c899b70cf 100644 --- a/test/parallel/test-http-chunk-problem.js +++ b/test/parallel/test-http-chunk-problem.js @@ -71,7 +71,11 @@ cp.exec(ddcmd, function(err, stdout, stderr) { res.writeHead(200); // Create the subprocess - const cat = cp.spawn('cat', [filename]); + let cat; + if (common.isWindows) + cat = cp.spawn('cmd.exe', ['/c', 'type', filename]); + else + cat = cp.spawn('cat', [filename]); // Stream the data through to the response as binary chunks cat.stdout.on('data', (data) => {