memfs
memfs copied to clipboard
watch an invalid path does not throw an exception
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
I'm pretty sure this is an issue with memfs
, not unionfs
.