Add spec for child_process.fork.
This commit is contained in:
parent
beb62566e4
commit
16d039ba47
2 changed files with 17 additions and 0 deletions
3
spec/fixtures/module/ping.js
vendored
Normal file
3
spec/fixtures/module/ping.js
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
process.on('message', function(msg) {
|
||||||
|
process.send(msg);
|
||||||
|
});
|
14
spec/node/child_process.coffee
Normal file
14
spec/node/child_process.coffee
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
assert = require 'assert'
|
||||||
|
child_process = require 'child_process'
|
||||||
|
path = require 'path'
|
||||||
|
|
||||||
|
describe 'child_process', ->
|
||||||
|
fixtures = path.join __dirname, '..', 'fixtures'
|
||||||
|
|
||||||
|
describe 'child_process.fork', ->
|
||||||
|
it 'should work', (done) ->
|
||||||
|
child = child_process.fork path.join(fixtures, 'module', '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