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
jest-config pulls the default value directly from argv.ci when deciding on the value of updateSnapshot.
Note that the problem isn't that Jest is failing to pick up on the CI env variable at all, because the difference between steps 3 and 4 shows that Jest is recognizing the presence of the variable and altering its behavior accordingly. It's specific to snapshot updating.
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.
Version
27.4.7
Steps to reproduce
npx jest --ci
. Note that the test fails, refusing to write the new snapshot.CI=1 npx jest
. Note that the test passes, and the snapshot is written. Also note that terminal colors are disabled (CI mode).npx jest
. Note that terminal colors are enabled (not CI mode).Expected behavior
Step 3 should behave the same as step 2: Jest should refuse to write the snapshot and the test should fail.
Actual behavior
In step 3, the snapshot is written and the test passes.
Additional context
The issue was introduced in #9924 (as noted in #9924 (comment)), so it has been present since Jest 27.0.0. The problem is here:
https://github.com/facebook/jest/blob/161452447a8cbc071447ba92a03efc63da1dd0b7/packages/jest-config/src/normalize.ts#L1123-L1128
jest-config
pulls the default value directly fromargv.ci
when deciding on the value ofupdateSnapshot
.Note that the problem isn't that Jest is failing to pick up on the
CI
env variable at all, because the difference between steps 3 and 4 shows that Jest is recognizing the presence of the variable and altering its behavior accordingly. It's specific to snapshot updating.Environment
The text was updated successfully, but these errors were encountered: