-
-
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
Disabling automock breaks detection of file extension when using moduleNameMapper #1320
Comments
As a workaround, can you use moduleDirectories instead? |
Using moduleDirectories works perfectly as a workaround, thanks! |
Ok, I think that's the right solution here actually. |
Isn't it weird that setting or not |
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. |
Hi,
I'm trying to setup with jest 13.2.3 on my current project. We use the webpack alias feature to get simpler module paths (eg.
import en from 'i18n/en';
instead ofimport en from '../../../../i18n/en'
), so I've followed this tutorial to setup thepackage.json
for jest, usingmoduleNameMapper
to setup this kind of rule:Which worked correctly in my test file:
However, when I tried to disable
automock
, either via settingautomock: true
in the package.json or usingjest.disableAutomock()
, I run into this file not found error:Error: ENOENT: no such file or directory, stat '/home/codeheroics/dev/front/src/i18n/en'
Am I misunderstanding something in my
moduleNameMapper
setup, or is there a need to activateautomock
to get correct file extension detection when using it ?(I'm overwriting
moduleFileExtensions
to handle .jsx files, but this problem exists with .js files whether or not it is overwritten)The text was updated successfully, but these errors were encountered: