Open hubol opened 3 years ago
I'm looking for that too. I tried using fs.readdirsync but to no avail.
yes that would be a great feature
fs.existsSync
and fs.readFileSync
are working as expected for me. Although a way to dump the mock-fs
filesystem object in console.log would be handy.
fs.existsSync
andfs.readFileSync
are working as expected for me. Although a way to dump themock-fs
filesystem object in console.log would be handy.
Try it:
import { Console } from 'console';
beforeEach(async () => {
global.console = new Console(process.stdout, process.stderr);
mockFs();
});
Getting the contents of the mock file system: JSON.stringify(mockFS.getMockRoot(), null, 2)
I want to see the contents of the mock file system to determine why a test of
fs.existsSync
is failing. It would be nice if I could somehow explore the structure of the file system in my debugger. ThegetMockRoot()
method looks interesting but I'm not sure it's what I need.Thanks :-)