Closed
Description
'use strict';
const fs = require('fs');
const mockfs = require('mock-fs');
mockfs({'/foo': {'a': '', 'b': '', 'c': ''}});
console.log('dir contents', fs.readdirSync('/foo'));
fs.watch('/foo', {}, function _onDirEvent(evt) {
console.log('evt', evt);
});
$ node foo.js
dir contents [ 'a', 'b', 'c' ]
fs.js:1236
throw error;
^
Error: watch /foo ENOENT
I could not find fs.watch
defined anywhere in mock-fs, but also saw that #207 removed a caveat about fs.watch
not being implemented. I'm not sure if I'm missing something obvious or if fs.watch
is unsupported.