spec: fix asar spec due to change in node.js

node.js rename the internalModuleReadFile to internalModuleReadJSON
change spec to reflect this change
This commit is contained in:
Jack Teng 2018-06-19 09:38:42 -07:00
parent 10df019075
commit 3044607746

View file

@ -682,21 +682,21 @@ describe('asar package', function () {
})
})
describe('internalModuleReadFile', function () {
var internalModuleReadFile = process.binding('fs').internalModuleReadFile
describe('internalModuleReadJSON', function () {
var internalModuleReadJSON = process.binding('fs').internalModuleReadJSON
it('read a normal file', function () {
var file1 = path.join(fixtures, 'asar', 'a.asar', 'file1')
assert.equal(internalModuleReadFile(file1).toString().trim(), 'file1')
assert.equal(internalModuleReadJSON(file1).toString().trim(), 'file1')
var file2 = path.join(fixtures, 'asar', 'a.asar', 'file2')
assert.equal(internalModuleReadFile(file2).toString().trim(), 'file2')
assert.equal(internalModuleReadJSON(file2).toString().trim(), 'file2')
var file3 = path.join(fixtures, 'asar', 'a.asar', 'file3')
assert.equal(internalModuleReadFile(file3).toString().trim(), 'file3')
assert.equal(internalModuleReadJSON(file3).toString().trim(), 'file3')
})
it('reads a normal file with unpacked files', function () {
var p = path.join(fixtures, 'asar', 'unpack.asar', 'a.txt')
assert.equal(internalModuleReadFile(p).toString().trim(), 'a')
assert.equal(internalModuleReadJSON(p).toString().trim(), 'a')
})
})