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

chore(jest-types): correct type testRegex for ProjectConfig #9780

Merged
merged 1 commit into from
Apr 8, 2020
Merged

chore(jest-types): correct type testRegex for ProjectConfig #9780

merged 1 commit into from
Apr 8, 2020

Conversation

ahnpnl
Copy link
Contributor

@ahnpnl ahnpnl commented Apr 7, 2020

Summary

Type of testRegex in ProjectConfig doesn't match with documentation and also not match with real capable value. It should be string | string[] | RegExp[]. This PR does 2 things:

  • Add Array<RegExp> to the existing type of testRegex in ProjectConfig.
  • Update documentation to add Array<RegExp> for testRegex in Configuration page.

I'm not entirely sure if testRegex in ProjectConfig can be string or not, but the documentation says it can be string as well. For now I just updated the type to add Array<RegExp> to the existing type. I observed that adding string will change quite something in internal codes so I won't touch.

Test plan

Green CI probably ?

@ahnpnl ahnpnl changed the title chore(jest-types): correct type for testRegex for ProjectConfig and update docs chore(jest-types): correct type testRegex for ProjectConfig and update docs Apr 7, 2020
@codecov-io
Copy link

codecov-io commented Apr 7, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@44a960d). Click here to learn what that means.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #9780   +/-   ##
=========================================
  Coverage          ?   64.91%           
=========================================
  Files             ?      288           
  Lines             ?    12203           
  Branches          ?     3026           
=========================================
  Hits              ?     7922           
  Misses            ?     3641           
  Partials          ?      640           
Impacted Files Coverage Δ
packages/jest-core/src/SearchSource.ts 60.60% <100.00%> (ø)
packages/jest-transform/src/shouldInstrument.ts 88.57% <100.00%> (ø)
packages/jest-matcher-utils/src/Replaceable.ts 100.00% <0.00%> (ø)
packages/jest-util/src/setGlobal.ts 0.00% <0.00%> (ø)
packages/expect/src/jasmineUtils.ts 92.10% <0.00%> (ø)
packages/jest-jasmine2/src/jasmine/CallTracker.ts 0.00% <0.00%> (ø)
packages/jest-jasmine2/src/jestExpect.ts 0.00% <0.00%> (ø)
...ages/jest-jasmine2/src/jasmine/ReportDispatcher.ts 0.00% <0.00%> (ø)
packages/jest-fake-timers/src/jestFakeTimers.ts 90.35% <0.00%> (ø)
packages/jest-config/src/validatePattern.ts 100.00% <0.00%> (ø)
... and 280 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 44a960d...6da11eb. Read the comment docs.

docs/Configuration.md Outdated Show resolved Hide resolved
@ahnpnl ahnpnl changed the title chore(jest-types): correct type testRegex for ProjectConfig and update docs chore(jest-types): correct type testRegex for ProjectConfig Apr 8, 2020
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.

thanks!

@SimenB SimenB merged commit c7f9080 into jestjs:master Apr 8, 2020
@ahnpnl
Copy link
Contributor Author

ahnpnl commented Apr 8, 2020

FYI, using tuple type [string, RegExp] will be similar to Array<string | RegExp>

@ahnpnl ahnpnl deleted the fix-test-regex-type branch April 8, 2020 13:09
jeysal added a commit to mmkal/jest that referenced this pull request Apr 10, 2020
…pshots

* upstream/master: (225 commits)
  docs: add CLA link to contributing docs (jestjs#9789)
  chore: roll new version of docs
  v25.3.0
  chore: update changelog for release
  chore(jest-types): correct type testRegex for ProjectConfig (jestjs#9780)
  feat(circus): enable writing async test event handlers (jestjs#9397)
  feat: enable all babel syntax plugins (jestjs#9774)
  chore: add helper for getting Jest's config in e2e tests (jestjs#9770)
  feat: pass ESM options to transformers (jestjs#9597)
  chore: replace `any`s with `unknown`s (jestjs#9626)
  feat: pass ESM options to Babel (jestjs#9766)
  chore(website): add copy button the code blocks (jestjs#9750)
  chore: bump istanbul-reports for new uncovered lines design (jestjs#9758)
  chore: correct CHANGELOG.md (jestjs#9763)
  chore(jest-types): expose type `CacheKeyOptions` for `getCacheK… (jestjs#9762)
  docs: Fix simple typo, seperated -> separated (jestjs#9760)
  v25.2.7
  chore: update changelog for release
  fix: drop getters and setters when diffing objects for error (jestjs#9757)
  chore(jest-types): correct return type of shouldRunTestSuite fo… (jestjs#9753)
  ...
@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