2016-06-23 01:21:21 +02:00
|
|
|
'use strict';
|
|
|
|
// Refs: https://github.com/nodejs/node/issues/7342
|
|
|
|
const common = require('../common');
|
|
|
|
const assert = require('assert');
|
|
|
|
const exec = require('child_process').exec;
|
|
|
|
|
2017-01-08 14:19:00 +01:00
|
|
|
let stdoutCalls = 0;
|
|
|
|
let stderrCalls = 0;
|
2016-06-23 01:21:21 +02:00
|
|
|
|
|
|
|
const command = common.isWindows ? 'dir' : 'ls';
|
2016-06-23 19:51:48 +02:00
|
|
|
exec(command).stdout.on('data', (data) => {
|
|
|
|
stdoutCalls += 1;
|
|
|
|
});
|
2016-06-23 01:21:21 +02:00
|
|
|
|
2016-06-23 19:51:48 +02:00
|
|
|
exec('fhqwhgads').stderr.on('data', (data) => {
|
|
|
|
assert.strictEqual(typeof data, 'string');
|
|
|
|
stderrCalls += 1;
|
|
|
|
});
|
2016-06-23 01:21:21 +02:00
|
|
|
|
2016-06-23 19:51:48 +02:00
|
|
|
process.on('exit', () => {
|
|
|
|
assert(stdoutCalls > 0);
|
|
|
|
assert(stderrCalls > 0);
|
|
|
|
});
|