0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-25 08:19:38 +01:00
nodejs/test/parallel/test-child-process-stdio.js
cjihrig 785481149d child_process: clone spawn options argument
spawnSync() modifies the options argument. This commit makes
a copy of options before any modifications occur.

Fixes: https://github.com/iojs/io.js/issues/576
PR-URL: https://github.com/iojs/io.js/pull/579
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-01-26 11:59:30 -05:00

20 lines
505 B
JavaScript

var common = require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn;
var options = {stdio: ['pipe']};
var child = common.spawnPwd(options);
assert.notEqual(child.stdout, null);
assert.notEqual(child.stderr, null);
options = {stdio: 'ignore'};
child = common.spawnPwd(options);
assert.equal(child.stdout, null);
assert.equal(child.stderr, null);
options = {stdio: 'ignore'};
child = common.spawnSyncCat(options);
assert.deepEqual(options, {stdio: 'ignore'});