Add test case for #83.
This commit is contained in:
parent
3b7dd85d3f
commit
ae18a90f7e
2 changed files with 18 additions and 0 deletions
11
spec/fixtures/module/fork_ping.js
vendored
Normal file
11
spec/fixtures/module/fork_ping.js
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
process.on('uncaughtException', function(error) {
|
||||
process.send(error.stack);
|
||||
});
|
||||
|
||||
var child = require('child_process').fork(__dirname + '/ping.js');
|
||||
process.on('message', function(msg) {
|
||||
child.send(msg);
|
||||
});
|
||||
child.on('message', function (msg) {
|
||||
process.send(msg);
|
||||
});
|
|
@ -12,3 +12,10 @@ describe 'child_process', ->
|
|||
assert.equal msg, 'message'
|
||||
done()
|
||||
child.send 'message'
|
||||
|
||||
it 'should work in forked process', (done) ->
|
||||
child = child_process.fork path.join(fixtures, 'module', 'fork_ping.js')
|
||||
child.on 'message', (msg) ->
|
||||
assert.equal msg, 'message'
|
||||
done()
|
||||
child.send 'message'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue