spec: child_process.fork shouble be able to pipe stdio
This commit is contained in:
parent
381da76967
commit
4d8994df92
2 changed files with 14 additions and 0 deletions
1
spec/fixtures/module/process-stdout.js
vendored
Normal file
1
spec/fixtures/module/process-stdout.js
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
process.stdout.write('pipes stdio')
|
|
@ -76,6 +76,19 @@ describe('node feature', function () {
|
|||
})
|
||||
child.send('message')
|
||||
})
|
||||
|
||||
it('pipes stdio', function (done) {
|
||||
let child = child_process.fork(path.join(fixtures, 'module', 'process-stdout.js'), {silent: true})
|
||||
let data = ''
|
||||
child.stdout.on('data', (chunk) => {
|
||||
data += String(chunk)
|
||||
})
|
||||
child.on('exit', (code) => {
|
||||
assert.equal(code, 0)
|
||||
assert.equal(data, 'pipes stdio')
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue