0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-child-process-stdio.js
Dennis Schwartz 366495d4e2 test: improve child_process tests
Replaced var keyword with const and let in the tests for child process
stdin and stdio.

PR-URL: https://github.com/nodejs/node/pull/8617
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
2016-09-19 23:33:56 +03:00

24 lines
633 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
let options = {stdio: ['pipe']};
let 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.deepStrictEqual(options, {stdio: 'ignore'});
assert.throws(() => {
common.spawnPwd({stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'ipc']});
}, /^Error: Child process can have only one IPC pipe$/);