From: Cheng Zhao Date: Wed, 12 Nov 2014 03:31:31 +0000 (+0800) Subject: spec: original-fs module X-Git-Tag: v0.19.2~15^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=90c24de0f08b94c64d51ead152686a71b696435b;p=electron.git spec: original-fs module --- diff --git a/spec/asar-spec.coffee b/spec/asar-spec.coffee index 12cbff79..b48394f8 100644 --- a/spec/asar-spec.coffee +++ b/spec/asar-spec.coffee @@ -391,3 +391,17 @@ describe 'asar package', -> ipc.on 'dirname', (event, dirname) -> assert.equal dirname, path.dirname(p) done() + + describe 'original-fs module', -> + originalFs = require 'original-fs' + + it 'uses the original fs api', -> + changedApis = ['readFile', 'stat', 'lstat', 'realpath', 'exists'] + unchangedApis = ['read', 'write', 'writeFile', 'close'] + assert.notStrictEqual fs[api], originalFs[api] for api in changedApis + assert.strictEqual fs[api], originalFs[api] for api in unchangedApis + + it 'treats .asar as file', -> + file = path.join fixtures, 'asar', 'a.asar' + stats = originalFs.statSync file + assert stats.isFile()