mirror of
https://github.com/HackPlan/atom-shell.git
synced 2026-04-24 03:46:03 +08:00
asar: make fs async methods create errors asynchronously
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user