Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
sets project name if empty fixes #5597 #5862
sets project name if empty fixes #5597 #5862
Changes from 17 commits
5756129
50d9933
6036dfa
be1cc18
6054f0b
feb9751
0bf6d8e
4f72619
b7c061f
0713d0f
65c64d9
a856fb1
04b0bb6
80d21e6
2f14830
30fecea
54302cf
be40277
8c8761d
78801aa
9bbbd61
61523b0
44aa91d
a370c21
1ab0bac
691339f
6fcab16
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
normalize
is run on every project config, once per run, data is not persisted. I don't think it's necessary to double loop like this. Seems like simply adding a timestamp to the equation fixes the problem (or maybe I'm missing a bigger picture @SimenB):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.
Math.random()
seems safer in case the loop completes in less than 1ms, but I agree that should probably solve it as wellThere 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.
Agreed. I'd go with
uuid/v4
for generating random number though, asMath.random
is not so random after all and I'd hate to debug issue like this 😅.Tested it locally and it fixes the issue (on Node 8, this particular example is not reproducible on Node 10)
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.
@thymikee which double loop do you mean? It's just a single loop through
projects
, isn't it?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.
normalize
is run for every project config, so essentially we loop throughprojects
once again here, hence double loop. And the solution I proposed doesn't have this 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.
Push it? 😀 I fixed my
Set
comment, would be nice to get this fix into Jest 24There 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.
Done. I checked the repro and it still works as expected. I should probably add an e2e test to be sure.
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.
this seems to fail on CI: https://circleci.com/gh/facebook/jest/17682