Open BadIdeaException opened 2 years ago
Once mockfs is inited, for now, you can use plain fs calls to populate the files.
True. The other way would still seem like a cleaner API to me, but I can see how this would probably not be a high-priority thing to implement. Thanks for the quick reply.
Probably add additional api like mockfs.merge
or mockfs.patch
.
We don't want the existing api surprises user if user forgot to call restore between two mockfs calls.
Yeah, I like that idea (although anyone not restore()
ing between tests is probably already in for a nasty surprise anyways).
Before I say anything else, let me say thank you for a job well done! mock-fs is awesome, it's easy to use and makes testing file-system related stuff much less painless and faster than dealing with the real thing.
To make it even more painless and easy to use: It would be very nice if there was some way to populate the mocked file system incrementally. This would allow to set up some common files in
before
andbeforeEach
, then add test-specific stuff within the actual test. Like this: