You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fs module accepts calls to FileHandle.close() when the underlying file no longer exists, while memfs throws ENOENT. I suspect this could be the root cause of #550 and #900.
Reproduction cases (ts-jest):
describe('memfs/fs parity',()=>{consttestPath=path.join(__dirname,'my-test-file');it('fs does not error on close after delete',async()=>{constf=awaitfs.open(testPath,'w');awaitfs.unlink(testPath);awaitf.close();});it('memfs should not error on close after delete',async()=>{constf=awaitmemfs.fs.promises.open(testPath,'w');awaitmemfs.fs.promises.unlink(testPath);awaitf.close();});});
Error message:
FAIL test/fs.spec.ts (5.259 s)
● memfs/fs parity › memfs should not error on close after delete
ENOENT: no such file or directory, open '/Users/dolan/IdeaProjects/big-shuffle/test/my-test-file'
at createError (node_modules/memfs/src/node/util.ts:138:17)
at Volume.openFile (node_modules/memfs/src/volume.ts:684:38)
at Volume.openBase (node_modules/memfs/src/volume.ts:696:23)
at Immediate.<anonymous> (node_modules/memfs/src/volume.ts:516:25)
The text was updated successfully, but these errors were encountered:
The
fs
module accepts calls toFileHandle.close()
when the underlying file no longer exists, whilememfs
throwsENOENT
. I suspect this could be the root cause of #550 and #900.Reproduction cases (ts-jest):
Error message:
The text was updated successfully, but these errors were encountered: