Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

scotthovestadt
Copy link
Contributor

@scotthovestadt scotthovestadt commented May 2, 2019

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.

if (projects.length > 1) {
if (
projects.length > 1 ||
(projects.length && typeof projects[0] === 'object')
Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, from #5176

@SimenB
Copy link
Member

SimenB commented May 2, 2019

Nice! Issue for it: #7496

@codecov-io
Copy link

codecov-io commented May 2, 2019

Codecov Report

Merging #8409 into master will increase coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
packages/jest-config/src/index.ts 11.94% <0%> (-0.56%) ⬇️
packages/jest-snapshot/src/utils.ts 93.33% <0%> (+0.9%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9081612...24d2d25. Read the comment docs.

Copy link
Member

@SimenB SimenB left a 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

@scotthovestadt
Copy link
Contributor Author

test added and passes! :)

@scotthovestadt
Copy link
Contributor Author

Applied to existing PR: #7498

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants