memfs icon indicating copy to clipboard operation
memfs copied to clipboard

watch an invalid path does not throw an exception

Open wood1986 opened this issue 3 years ago • 1 comments

after union the fs, ufs.watch an invalid path does not throw an exception. The behaviour is different from fs.watch

Here is the reproducible repo

git clone https://github.com/wood1986/unionfs-bug.git

const fs = require(`fs`);
const {ufs} = require(`unionfs`);
const {fs:memfs} = require(`memfs`);

const {patchFs} = require(`fs-monkey`);
  ufs
  .use(memfs)
  .use({...fs});
let unpatchFs = patchFs(ufs);

console.log("ufs.watch('a')", ufs.watch("a"))  // <<< does not throw exception which is wrong
console.log("fs.watch('a')", fs.watch("a"))    // <<< does not throw exception which is wrong

unpatchFs()
console.log("fs.watch('a')", fs.watch("a"))    // << does throw exception which is right

wood1986 avatar Oct 02 '21 22:10 wood1986

I'm pretty sure this is an issue with memfs, not unionfs.

G-Rath avatar Jun 24 '22 20:06 G-Rath