-
-
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 init when there is one project in projects
config.
#8409
Conversation
if (projects.length > 1) { | ||
if ( | ||
projects.length > 1 || | ||
(projects.length && typeof projects[0] === 'object') |
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.
I think there is actually a deeper issue here that will require more than this quick fix, since the types seem convinced it's a string
when my understanding (from it's use at FB) is that it can be a string or a config.
However, this solves the immediate issue.
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.
yup, from #5176
Nice! Issue for it: #7496 |
Codecov Report
@@ Coverage Diff @@
## master #8409 +/- ##
==========================================
+ Coverage 62.33% 62.35% +0.01%
==========================================
Files 266 266
Lines 10730 10742 +12
Branches 2613 2617 +4
==========================================
+ Hits 6689 6698 +9
- Misses 3459 3461 +2
- Partials 582 583 +1
Continue to review full report at Codecov.
|
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.
Possible to add an e2e test? What about the one from #7498?
Missing changelog entry
test added and passes! :) |
Applied to existing PR: #7498 |
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. |
Summary
There may be cases where users have a single project in the
projects
config (because of conditional projects). Currently, this doesn't go through the same code path as multiple projects and I've noticed it causing Jest fail to initialize.Test plan
Added test from issue #7496 (PR #7498).
All existing tests pass.
I manually tested that Jest initializes correctly with single project.