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(config): verify testMatchPatterns contain RegExp instance or string #1569

Merged
merged 1 commit into from Apr 27, 2020

Conversation

ahnpnl
Copy link
Collaborator

@ahnpnl ahnpnl commented Apr 27, 2020

Summary

Jest config which is passed to transformer doesn’t always contain the correct value of testRegex, see jestjs/jest#9778. Since we rely on this, we should add a filter to make sure we get out the patterns which are RegExp instance or type string.

Also we add a fallback to default testMatch value, see https://jestjs.io/docs/en/configuration#testmatch-arraystring in case no patterns valid by the check above.

Fix #1552

Test plan

  • Added unit tests.
  • Green CI

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

N.A.

@ahnpnl ahnpnl requested a review from kulshekhar as a code owner April 27, 2020 11:56
@ahnpnl
Copy link
Collaborator Author

ahnpnl commented Apr 27, 2020

@kulshekhar this can be released as a bug fix version if we need so I target merge to master.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4543

  • 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 92.884%

Totals Coverage Status
Change from base Build 4538: 0.04%
Covered Lines: 1120
Relevant Lines: 1155

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: pattern.test is not a function after upgrading to 25.4.0
3 participants