spec: child_process.fork shouble be able to pipe stdio

This commit is contained in:
Cheng Zhao 2016-05-31 10:26:19 +09:00
parent 381da76967
commit 4d8994df92
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1 @@
process.stdout.write('pipes stdio')

View file

@ -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()
})
})
})
})