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
Automatic use of .babelrc causes TypeError: Cannot read property 'globals' of undefined #4954
Comments
The most recent beta of |
@loganfsmyth I'm using But the problem here is I don't want to use |
|
Ah this works (around)! :) Thanks @loganfsmyth for pointing that out. |
Closing as this is working as intended, and the workaround in the docs works. Thanks for chiming in @loganfsmyth!
Why do you think that? |
@SimenB setting an empty object to disable an unrelated, sub-component is not right, not elegant. The user should opt-in to enable such a behavior. Otherwise, it still feels buggy to me. When you look at the configuration, you feel you can/should just delete {
"jest": {
"transform": {}
}
} |
I'll say I think it's weird. I didn't realize |
Thanks for this workaround, it worked for me. |
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. |
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
As @cpojer mentions here, Jest uses
.babelrc
(orbabel
property inpackage.json
) only because it exists there. Even in cases where the configuration and usage does not even relate to or trigger babel.jest --coverage
throws error below:If I remove the
babel
section frompackage.json
,jest
will work as expected.If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can
yarn install
andyarn test
.jest
andbabel
configurations in yourpackage.json
jest --coverage
Above error will occur.
What is the expected behavior?
Do not automatically use
.babelrc
orbabel
property inpackage.json
.Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
Below is part of my package.json with
jest
andbabel
properties:The text was updated successfully, but these errors were encountered: