You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Jest is ignoring babelrc env:test settings, sometimes. Seems that after jest has failed from a babelrc misconfig, it can not recover even when the config has been corrected (as if .babelrc is being cached only when an error happens).
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 and yarn test.
If you clone, yarn install, and yarn test - everything will pass! Great! This was a huge surprise to me because I discovered this after cloning this reproduction to confirm that you'd see it fail like I am locally. Huh? In other words my original origin is failing, but the clone of remote that came from origin isn't (exact same code)!?
Now, change .bablerc to look like the following:
{
"presets": [
["env", {
"modules": false
}]
]
}
This will understandably fail because of the modules: false for all envs. But now here's the thing, put the .babelrc back the way it was, with the "env":{"test":{"presets":[["env", {"modules":"commonjs"}]]}} part, and your tests that used to pass under this exact config should fail. At least in a messed up way I hope it does so we can get to the bottom of this! ;P
What is the expected behavior?
I would expect the before and after scenarios mentioned above to output the same results.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
node 6.8.0
npm 3.10.8
yarn 0.19.1
jest 19.0.2
OSX El Capitan 10.11.5
Also, for good measure, I have tried removing and reinstalling after the failure. I have also ran yarn cache clean && rm -rvf node_modules && yarn install && yarn test. Once it fails, the correct config makes no difference.
The test will pass if a) fresh clone of repo or b) copy files (after the whole failure switcharoo scenario) to a new directory.
The text was updated successfully, but these errors were encountered:
Sorry to spam your issues. I just went through the steps I mentioned above again (fresh clone, switched babelrc back and forth), and the tests do pass again. The original local repo, however, which is the same code (with env:test part), still won't pass. Copying the code from this local repo to a different folder, however, does result in passing tests. Wish I could provide you with something more concretely reproducible.
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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Jest is ignoring babelrc env:test settings, sometimes. Seems that after jest has failed from a babelrc misconfig, it can not recover even when the config has been corrected (as if
.babelrc
is being cached only when an error happens).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
.Bare with me, this is pretty annoying.
https://github.com/Lokua/throw-away-jest-repro.
If you clone,
yarn install
, andyarn test
- everything will pass! Great! This was a huge surprise to me because I discovered this after cloning this reproduction to confirm that you'd see it fail like I am locally. Huh? In other words my original origin is failing, but the clone of remote that came from origin isn't (exact same code)!?Now, change
.bablerc
to look like the following:This will understandably fail because of the
modules: false
for all envs. But now here's the thing, put the.babelrc
back the way it was, with the"env":{"test":{"presets":[["env", {"modules":"commonjs"}]]}}
part, and your tests that used to pass under this exact config should fail. At least in a messed up way I hope it does so we can get to the bottom of this! ;PWhat is the expected behavior?
I would expect the before and after scenarios mentioned above to output the same results.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
node 6.8.0
npm 3.10.8
yarn 0.19.1
jest 19.0.2
OSX El Capitan 10.11.5
Also, for good measure, I have tried removing and reinstalling after the failure. I have also ran
yarn cache clean && rm -rvf node_modules && yarn install && yarn test
. Once it fails, the correct config makes no difference.The test will pass if a) fresh clone of repo or b) copy files (after the whole failure switcharoo scenario) to a new directory.
The text was updated successfully, but these errors were encountered: