spec: original-fs is available in forked scripts

This commit is contained in:
Cheng Zhao 2015-05-20 13:37:46 +08:00
parent fa169ee7ff
commit efd8a8a624
2 changed files with 14 additions and 3 deletions

View file

@ -1,4 +1,5 @@
assert = require 'assert'
child_process = require 'child_process'
fs = require 'fs'
path = require 'path'
@ -443,6 +444,13 @@ describe 'asar package', ->
stats = originalFs.statSync file
assert stats.isFile()
it 'is available in forked scripts', (done) ->
child = child_process.fork path.join(fixtures, 'module', 'original-fs.js')
child.on 'message', (msg) ->
assert.equal msg, 'object'
done()
child.send 'message'
describe 'graceful-fs module', ->
gfs = require 'graceful-fs'

3
spec/fixtures/module/original-fs.js vendored Normal file
View file

@ -0,0 +1,3 @@
process.on('message', function (msg) {
process.send(typeof require('original-fs'));
});