-
-
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
Automocker __mocks__/
discovery should support node modules with @namespace/module
naming.
#462
Comments
I recommend using |
I have a similar issue with importing modules from Braintree - in my code I'm importing modules from My current workaround is to manually map the module names in "moduleNameMapper": {
"braintree-web/client": "<rootDir>/__mocks__/braintree-web/client",
}, |
If your mock is light to setup, and you use it a lot, you can add the We had the same issue for our translation lib, which is used in 200 of our test files. |
Thanks for the idea @flepretre but I just tried removing my ¯\_(ツ)_/¯ |
I should have done some mistake somewhere with the mock because it's definitively working now! |
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'm having a hard time getting the autoMocker to find manual mocks in the
__mocks__/
folderwhen the module name includes a
@namespaces
, e.g.require('@quux/foo');
Tried this:
&&
Right now I've ended up using
setMock('@quux/foo', mockInstance)
and pulling inmockInstance
withrequire.requireActual
but it seems less than ideal.Other ideas? Or will this be supported in 0.5.x?
The text was updated successfully, but these errors were encountered: