spec: Script forked with child_process supports asar archives

This commit is contained in:
Cheng Zhao 2015-02-04 10:52:09 -08:00
parent 45e2dd2ab5
commit f214e88784
2 changed files with 12 additions and 0 deletions

View file

@ -347,6 +347,14 @@ describe 'asar package', ->
throws = -> child_process.fork p
assert.throws throws, /ENOENT/
it 'supports asar in the forked js', (done) ->
file = path.join fixtures, 'asar', 'a.asar', 'file1'
child = child_process.fork path.join(fixtures, 'module', 'asar.js')
child.on 'message', (content) ->
assert.equal content, fs.readFileSync(file).toString()
done()
child.send file
describe 'asar protocol', ->
url = require 'url'
remote = require 'remote'

4
spec/fixtures/module/asar.js vendored Normal file
View file

@ -0,0 +1,4 @@
var fs = require('fs');
process.on('message', function(file) {
process.send(fs.readFileSync(file).toString());
});