Simply requiring mock-fs causes fs.readdir() to never call its callback. This interferes with using the real filesystem, and mock.restore() doesn't fix the issue. I never even call mock(...) itself.
Tried on 6.2.0, 6.0.0 and 5.0.0 - the example below works properly on 5.0.0, but breaks on the 6.0.0+ versions.
var fs = require('fs');
fs.readdir('.', (err, files) => console.log(err,files)); // works OK
var mockfs = require('mock-fs');
fs.readdir('.', (err, files) => console.log(err,files)); // never called on 6.0.0+
mockfs.restore();
fs.readdir('.', (err, files) => console.log(err,files)); // never called on 6.0.0+
This is on Mac OS X - not sure if it happens elsewhere.
Simply requiring
mock-fs
causes fs.readdir() to never call its callback. This interferes with using the real filesystem, andmock.restore()
doesn't fix the issue. I never even callmock(...)
itself.Tried on 6.2.0, 6.0.0 and 5.0.0 - the example below works properly on 5.0.0, but breaks on the 6.0.0+ versions.
This is on Mac OS X - not sure if it happens elsewhere.