diff --git a/test/README.md b/test/README.md index 653f78cc6d2eb5..ae549420624ccc 100644 --- a/test/README.md +++ b/test/README.md @@ -376,24 +376,12 @@ Path to the 'root' directory. either `/` or `c:\\` (windows) Logs '1..0 # Skipped: ' + `msg` -### spawnCat(options) -* `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) -* return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) - -Platform normalizes the `cat` command. - ### spawnPwd(options) * `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) * return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) Platform normalizes the `pwd` command. -### spawnSyncCat(options) -* `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) -* return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) - -Synchronous version of `spawnCat`. - ### spawnSyncPwd(options) * `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) * return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) diff --git a/test/common.js b/test/common.js index 99ea679114c038..85b2393c559a23 100644 --- a/test/common.js +++ b/test/common.js @@ -237,28 +237,6 @@ exports.ddCommand = function(filename, kilobytes) { }; -exports.spawnCat = function(options) { - const spawn = require('child_process').spawn; - - if (exports.isWindows) { - return spawn('more', [], options); - } else { - return spawn('cat', [], options); - } -}; - - -exports.spawnSyncCat = function(options) { - const spawnSync = require('child_process').spawnSync; - - if (exports.isWindows) { - return spawnSync('more', [], options); - } else { - return spawnSync('cat', [], options); - } -}; - - exports.spawnPwd = function(options) { const spawn = require('child_process').spawn; diff --git a/test/parallel/test-child-process-spawn-shell.js b/test/parallel/test-child-process-spawn-shell.js index 444d1eb063ca4a..e9dd0e07efaa0c 100644 --- a/test/parallel/test-child-process-spawn-shell.js +++ b/test/parallel/test-child-process-spawn-shell.js @@ -34,7 +34,7 @@ echo.on('close', common.mustCall((code, signal) => { })); // Verify that shell features can be used -const cmd = common.isWindows ? 'echo bar | more' : 'echo bar | cat'; +const cmd = 'echo bar | cat'; const command = cp.spawn(cmd, { encoding: 'utf8', shell: true diff --git a/test/parallel/test-child-process-spawnsync-shell.js b/test/parallel/test-child-process-spawnsync-shell.js index 1d92767a8b5ba5..9e03ee126f087b 100644 --- a/test/parallel/test-child-process-spawnsync-shell.js +++ b/test/parallel/test-child-process-spawnsync-shell.js @@ -23,7 +23,7 @@ assert.strictEqual(echo.args[echo.args.length - 1].replace(/"/g, ''), assert.strictEqual(echo.stdout.toString().trim(), 'foo'); // Verify that shell features can be used -const cmd = common.isWindows ? 'echo bar | more' : 'echo bar | cat'; +const cmd = 'echo bar | cat'; const command = cp.spawnSync(cmd, {shell: true}); assert.strictEqual(command.stdout.toString().trim(), 'bar'); diff --git a/test/parallel/test-child-process-stdin.js b/test/parallel/test-child-process-stdin.js index 8782e46f8f7229..a4c8e359494696 100644 --- a/test/parallel/test-child-process-stdin.js +++ b/test/parallel/test-child-process-stdin.js @@ -4,7 +4,7 @@ const assert = require('assert'); const spawn = require('child_process').spawn; -const cat = spawn(common.isWindows ? 'more' : 'cat'); +const cat = spawn('cat'); cat.stdin.write('hello'); cat.stdin.write(' '); cat.stdin.write('world'); @@ -33,9 +33,5 @@ cat.on('exit', common.mustCall(function(status) { })); cat.on('close', common.mustCall(function() { - if (common.isWindows) { - assert.strictEqual('hello world\r\n', response); - } else { - assert.strictEqual('hello world', response); - } + assert.strictEqual('hello world', response); })); diff --git a/test/parallel/test-child-process-stdio-inherit.js b/test/parallel/test-child-process-stdio-inherit.js index d2b64aeb30dd31..068d525d70ff32 100644 --- a/test/parallel/test-child-process-stdio-inherit.js +++ b/test/parallel/test-child-process-stdio-inherit.js @@ -1,5 +1,5 @@ 'use strict'; -const common = require('../common'); +require('../common'); const assert = require('assert'); const spawn = require('child_process').spawn; @@ -31,5 +31,5 @@ function grandparent() { function parent() { // should not immediately exit. - common.spawnCat({ stdio: 'inherit' }); + spawn('cat', [], { stdio: 'inherit' }); } diff --git a/test/parallel/test-child-process-stdio.js b/test/parallel/test-child-process-stdio.js index 3c67b3c3fe37a0..0fb7909b024f51 100644 --- a/test/parallel/test-child-process-stdio.js +++ b/test/parallel/test-child-process-stdio.js @@ -1,6 +1,7 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); +const spawnSync = require('child_process').spawnSync; let options = {stdio: ['pipe']}; let child = common.spawnPwd(options); @@ -15,7 +16,7 @@ assert.strictEqual(child.stdout, null); assert.strictEqual(child.stderr, null); options = {stdio: 'ignore'}; -child = common.spawnSyncCat(options); +child = spawnSync('cat', [], options); assert.deepStrictEqual(options, {stdio: 'ignore'}); assert.throws(() => {