mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: support the throwIfNoEntry option to statSync and lstatSync in asar files (#40221)
This commit is contained in:
@@ -490,6 +490,15 @@ describe('asar package', function () {
|
||||
}).to.throw(/ENOENT/);
|
||||
}
|
||||
});
|
||||
|
||||
itremote('returns null when can not find file with throwIfNoEntry === false', function () {
|
||||
const ref2 = ['file4', 'file5', path.join('dir1', 'file4')];
|
||||
for (let j = 0, len = ref2.length; j < len; j++) {
|
||||
const file = ref2[j];
|
||||
const p = path.join(asarDir, 'a.asar', file);
|
||||
expect(fs.lstatSync(p, { throwIfNoEntry: false })).to.equal(null);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('fs.lstat', function () {
|
||||
|
||||
Reference in New Issue
Block a user