asar: make fs async methods create errors asynchronously

This commit is contained in:
deepak1556
2015-04-21 15:20:08 +05:30
parent c424d0e9f3
commit da648511b3
2 changed files with 44 additions and 24 deletions

View File

@@ -36,6 +36,14 @@ describe 'asar package', ->
throws = -> fs.readFileSync p
assert.throws throws, /ENOENT/
it 'passes ENOENT error to callback when can not find file', ->
p = path.join fixtures, 'asar', 'a.asar', 'not-exist'
async = false
fs.readFile p, (e) ->
assert async
assert /ENOENT/.test e
async = true
describe 'fs.readFile', ->
it 'reads a normal file', (done) ->
p = path.join fixtures, 'asar', 'a.asar', 'file1'