Closed ryan-roemer closed 5 years ago
@ryan-roemer please try out mock-fs@4.9.0 for the fix (thanks @huochunpeng).
@tschaub -- Works like a charm! My (very heavily leveraging mock-fs
) tests now pass in 8, 10, 11 for Travis and Appveyor: https://github.com/FormidableLabs/inspectpack/pull/113
Thanks for the fantastic work @huochunpeng !
🎉 🙏 🎉
First of all, fantastic library!!!. I've been putting off my CI upgrades to node 10.5+ because of mock-fs not supporting them yet. Seeing as that great work is merged, I attempted to upgrade, but hit the issue that I've honed down to this reproduction:
The issue is that doing a mix of a real
readFile
and then amock()
call and then anotherreadFile
(the calls don't have to match the same file) results in the mocked, secondreadFile
call hanging the process.And more specifically, if that file exists as a mock for
"package.json"
, the process hangs. If instead,mock()
is used, there is anENOENT
thrown as expected because the mocked file isn't found.Usage:
I'm not sure exactly what's up internally, but hopefully this is pretty straightforward reproduction. Let me know if I can provide any more info.
Apologies if there is something obvious / configuration-wise / etc. that I'm missing as to why this isn't working for me...
Thanks!