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 serialization issues with RegExp instances in the normalized config #7251

Merged

Conversation

rubennorte
Copy link
Contributor

Summary

Fixes #7242 introduced in #7209, where the configuration was incorrectly serialized as it contained RegExp instances (incompatible with the automatic JSON serialization done natively by Node.js in child_process.send.

Test plan

Updated unit and e2e tests.

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.

Makes sense! Should revert (but keep the test) later :)

packages/jest-runtime/src/should_instrument.js Outdated Show resolved Hide resolved
Copy link
Contributor

@rafeca rafeca left a comment

Choose a reason for hiding this comment

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

Wow! That was fast! Thanks a lot! ❤️

@rubennorte
Copy link
Contributor Author

@SimenB I'm not sure I got that. Do you mean that we should revert this when we decide what to do with the serialization issue?

@SimenB
Copy link
Member

SimenB commented Oct 23, 2018

Do you mean that we should revert this when we decide what to do with the serialization issue?

Yes :) I think we should normalize all config in jest-config before passing it on to other parts of jest

@rubennorte
Copy link
Contributor Author

It's tricky when the workers are involved, but I agree.

@rubennorte
Copy link
Contributor Author

rubennorte commented Oct 23, 2018

I didn't notice that #7207 that was created as a prerequisite for #7209 and introduced changes to the original ValidConfig. I changed the new MultipleValidOptions thing to return the same array so when printing the configuration it's correct and minor changes in the naming.

@rubennorte rubennorte force-pushed the fix-config-serialization-with-regexes branch from 0240d6e to 8c633db Compare October 24, 2018 09:58
@codecov-io
Copy link

Codecov Report

Merging #7251 into master will decrease coverage by 0.04%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #7251      +/-   ##
=========================================
- Coverage   66.55%   66.5%   -0.05%     
=========================================
  Files         237     241       +4     
  Lines        9317    9328      +11     
  Branches        4       6       +2     
=========================================
+ Hits         6201    6204       +3     
- Misses       3115    3121       +6     
- Partials        1       3       +2
Impacted Files Coverage Δ
packages/babel-jest/src/index.js 40.74% <ø> (ø) ⬆️
packages/jest-config/src/ValidConfig.js 100% <ø> (ø) ⬆️
packages/jest-validate/src/index.js 0% <0%> (ø) ⬆️
packages/jest-config/src/normalize.js 85.47% <100%> (-0.3%) ⬇️
packages/jest-runtime/src/should_instrument.js 100% <100%> (ø) ⬆️
packages/jest-cli/src/SearchSource.js 57.69% <100%> (ø) ⬆️
packages/jest-validate/src/condition.js 100% <100%> (ø) ⬆️
packages/jest-cli/src/getNoTestsFoundMessage.js 60% <0%> (ø) ⬆️
packages/jest-cli/src/getNoTestFoundFailed.js 0% <0%> (ø) ⬆️
... and 16 more

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 319329f...8c633db. Read the comment docs.

@rubennorte rubennorte merged commit d5c74a2 into jestjs:master Oct 24, 2018
@rubennorte rubennorte deleted the fix-config-serialization-with-regexes branch October 24, 2018 12:33
@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 12, 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.

jest fails to generate coverage when using the testRegex config option
5 participants