-
-
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
fix(jest-config): correctly detect CI environment and update snapshots accordingly #12378
Conversation
to determine option.updateSnapshot
@@ -1131,8 +1131,12 @@ export default async function normalize( | |||
newOptions.moduleNameMapper = []; | |||
} | |||
|
|||
if (argv.ci != null) { | |||
newOptions.ci = argv.ci; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newOptions
already has the default checking the env var in it, so this only overrides that if argv
has a value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Codecov Report
@@ Coverage Diff @@
## main #12378 +/- ##
==========================================
+ Coverage 68.47% 68.48% +0.01%
==========================================
Files 324 324
Lines 16967 16969 +2
Branches 5060 5061 +1
==========================================
+ Hits 11618 11622 +4
+ Misses 5317 5315 -2
Partials 32 32
Continue to review full report at Codecov.
|
This comment was marked as spam.
This comment was marked as spam.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixed #12288
Summary
The cause of this problem is that the current implementation for determining
option.updateSnapshot
does not take into accountprocess.env.CI
. We can know the value ofprocess.env.CI
inDEFAULT_CONFIG.ci
.Test plan
This PR added test cases for
option.updateSnapshot
and also fixed type issues byas
assertions.