Skip to content

Commit 044a0be

Browse files
TrottFishrock123
authored andcommitted
test: add test for exec() known issue
PR-URL: #7375 Refs: #7342 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
1 parent c4d3580 commit 044a0be

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict';
2+
// Refs: https://github.com/nodejs/node/issues/7342
3+
const common = require('../common');
4+
const assert = require('assert');
5+
const exec = require('child_process').exec;
6+
7+
const expectedCalls = 2;
8+
9+
const cb = common.mustCall((data) => {
10+
assert.strictEqual(typeof data, 'string');
11+
}, expectedCalls);
12+
13+
const command = common.isWindows ? 'dir' : 'ls';
14+
exec(command).stdout.on('data', cb);
15+
16+
exec('fhqwhgads').stderr.on('data', cb);

0 commit comments

Comments
 (0)