-
Notifications
You must be signed in to change notification settings - Fork 31
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
It is not possible to mock non-existing files(?) #46
Comments
It's possible, but I am actually planning to disable this possibility at all, to make life easier - not let you to make a mistake. Is there any reason to import something non existing in your case? |
I am unit testing a script that should require and execute some files based on a parameter. Basically, tell a script that we want to do X, and the handler will require X.js and it will do something with that file, like call some methods etc. So if you disable it by default I urge you to make it possible and easy to circumvent it. But you say it is currently possible? I was not able to get it to work and I did not find the answer in the documentation, could you please provide an example? |
Rewiremock could mock everything, but it's a tricky thing to explain what to mock. Stuff like relative names may cause some issues. |
So - it was not possible before :) |
Allow require non-existing files, fixes #46
I can not figure out why
does not work but
does.
Is it possible to mock files that do not yet exist like for example mock-require does?
The text was updated successfully, but these errors were encountered: