From b627b8711a3f570c5b349d64f184f795e84369f5 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 25 Jul 2016 11:17:40 -0700 Subject: [PATCH] Add spec for accessing normal files --- spec/asar-spec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/asar-spec.js b/spec/asar-spec.js index 45278c302495..81f6ebe2161d 100644 --- a/spec/asar-spec.js +++ b/spec/asar-spec.js @@ -540,6 +540,14 @@ describe('asar package', function () { }) describe('fs.access', function () { + it('accesses a normal file', function (done) { + var p = path.join(fixtures, 'asar', 'a.asar', 'file1') + fs.access(p, function (err) { + assert(err == null) + done() + }) + }) + it('throws an error when called with write mode', function (done) { var p = path.join(fixtures, 'asar', 'a.asar', 'file1') fs.access(p, fs.constants.R_OK | fs.constants.W_OK, function (err) { @@ -566,6 +574,13 @@ describe('asar package', function () { }) describe('fs.accessSync', function () { + it('accesses a normal file', function () { + var p = path.join(fixtures, 'asar', 'a.asar', 'file1') + assert.doesNotThrow(function () { + fs.accessSync(p) + }) + }) + it('throws an error when called with write mode', function () { var p = path.join(fixtures, 'asar', 'a.asar', 'file1') assert.throws(function () {