-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Enable manual mocks with nested folders #2475
Comments
I think I'd be supportive of such a change. This would be for dependencies in node_modules specifically, right? |
Thanks @cpojer. |
Closing this in favor of the PR (I'll get to it next week). |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I know that previous issues around this topic have been closed but I spent some time investigating (mainly to learn something new).
I found out that tweaking the value returned from getMockName makes the mocks with nested folders work and the tests (except one) are still green.
I'm pretty sure I'm missing something but, if the method, given the following path:
'/fruits/__mocks__/subdir1/blueberry.js'
returns this:
'subdir1/blueberry'
instead of this:
'blueberry'
everything seems to work apart from the "warns on duplicate mock files" test (which is ok because the mocks are not duplicated anymore, being in different subdirs).
If I'm on the wrong path and/or you are not interested in going further please tell me.
Otherwise, I'll be more than happy to submit a PR and show you the changes I made.
Thanks!
The text was updated successfully, but these errors were encountered: