bf4756fdfb
The uv_spawn under Windows requires the PATH environment variable to be there, otherwise it would throw a 203 system error, it should be a bug of node.
30 lines
1 KiB
CoffeeScript
30 lines
1 KiB
CoffeeScript
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'
|
|
|
|
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'
|
|
|
|
it 'should work in forked process when options.env is specifed', (done) ->
|
|
child = child_process.fork path.join(fixtures, 'module', 'fork_ping.js'),
|
|
[],
|
|
path: process.env['PATH']
|
|
child.on 'message', (msg) ->
|
|
assert.equal msg, 'message'
|
|
done()
|
|
child.send 'message'
|