tschaub / mock-fs

Configurable mock for the fs module
https://npmjs.org/package/mock-fs
Other
911 stars 86 forks source link

Request: dump mock file system for easy inspection #90

Closed abelnation closed 7 years ago

abelnation commented 8 years ago

a method like mockFs.dump() would be nice for debugging/inspecting

jprichardson commented 8 years ago

You can do this by getting the binding.

Example:

var mockfs = require('mock-fs')
var fs = mockfs.fs()
var binding = fs.__get__('binding')
console.dir(binding._system._root)
ciaranj commented 7 years ago

As far as I can tell this only works for mockfs.fs, rather than mockfs(). Is that intentional?

tschaub commented 7 years ago

This was fixed by @ciaranj in #194 and is included in the mock-fs@4 release.