Skip to content

fix(config): verify testMatchPatterns contain RegExp instance or string - #1569

Merged
ahnpnl merged 1 commit into
masterfrom
fix-1552
Apr 27, 2020
Merged

ahnpnl merged 1 commit into
masterfrom
fix-1552

Conversation

@ahnpnl

@ahnpnl ahnpnl commented Apr 27, 2020 •

Copy link
Copy Markdown
Collaborator

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

ahnpnl commented Apr 27, 2020

Copy link
Copy Markdown
Collaborator Author

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

@coveralls

Copy link
Copy Markdown

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

@ahnpnl
ahnpnl merged commit 7f85bab into master Apr 27, 2020
@ahnpnl
ahnpnl deleted the fix-1552 branch April 27, 2020 14:23
ahnpnl added a commit that referenced this pull request Apr 28, 2020
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