From 90c24de0f08b94c64d51ead152686a71b696435b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 12 Nov 2014 11:31:31 +0800 Subject: [PATCH] spec: original-fs module --- spec/asar-spec.coffee | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/asar-spec.coffee b/spec/asar-spec.coffee index 12cbff7989ae..b48394f8e21d 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()