Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support or instructions for webpack #63

Open
kmalakoff opened this issue Oct 5, 2015 · 3 comments
Open

Support or instructions for webpack #63

kmalakoff opened this issue Oct 5, 2015 · 3 comments

Comments

@kmalakoff
Copy link

I've been trying to get mock-fs working with webpack for a while. I'm not sure if mock-fs is not designed for a browser, but I'm trying to get webpack's dir-loader working with mocks.

It doesn't seem to be working and there are no instructions so I'm assuming this is not possible. Please let me know if there is support or plans for support for browser testing using mock-fs.

The use case is that I'm writing an electron app that works offline and uses js-git so I am hoping to use mock-fs to abstract out file operations and to speed up by development cycle since electron is quite slow to refresh and develop on.

Also, unless I'm missing something, it seems a little strange that a mocking library would depend on the original implementation.

@tschaub
Copy link
Owner

tschaub commented Jan 27, 2016

@kmalakoff mock-fs relies heavily on Node's fs module, patching it only to provide a swappable binding (the result of process.binding('fs')).

It may actually not be that much more work to provide overrides for every fs function, but when this project started, I was attracted to the smaller API exposed by the binding.

@augustoamerico
Copy link

@kmalakoff I am facing the same problem with a similar use case. What was your workarround?

@kmalakoff
Copy link
Author

@augustoamerico: my workaround was to write my own module and webpack loader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants