-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Add help for configuration of collectCoverageFrom #6663
Conversation
Due to breaking changes in an upgrade of the dependency micromatch from ^2.3.11 to ^3.1.10 many users saw their coverage reporting failing because their glob matching was in an unsupported format. Adding the help text here gives users a good starting point for debugging when they run into issues rlated to this option. This will help alleviate support issues (such as jestjs#6563) concerning this configuration option.
Codecov Report
@@ Coverage Diff @@
## master #6663 +/- ##
=======================================
Coverage 63.73% 63.73%
=======================================
Files 235 235
Lines 8940 8940
Branches 4 4
=======================================
Hits 5698 5698
Misses 3241 3241
Partials 1 1 Continue to review full report at Codecov.
|
We've just merged a rollback yesterday and will hopefully patch today. This is however going to be useful for Jest 24 |
Yes, I figured this would be helpful in the future. I was one of the folks that couldn't figure out why coverage reporting had broken but didn't have time to dig into debugging it. It ended up being a one line fix, I think this would guide most users in the right direction when they encounter problems here. |
Not really related to this, ,but since we know about all files in your project, it would be cool to have like an interactive prompt (kinda like https://github.com/jest-community/jest-watch-typeahead/) that allowed you to type out your regexes and see what they match. For for which to match and which to ignore, for tests, transform, coverage etc. Probably something that should live outside of core, but basically |
I agree, that would be awesome! I was even searching around the web seeing if micromatch had an online glob tester so I could be sure my globs really were legitimate. minimatch has one at http://www.globtester.com/, was surprised micromatch didn't have something similar. I haven't looked into the jest plugin/hook stuff, might have to take a stab at that someday. |
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. |
Due to breaking changes in an upgrade of the dependency micromatch
from ^2.3.11 to ^3.1.10 many users saw their coverage reporting
failing because their glob matching was in an unsupported format.
Adding the help text here gives users a good starting point for
debugging when they run into issues related to this option. This will
help alleviate support issues (such as #6563) concerning this configuration
option.
Summary
Give users a hint as to what could be causing an unexpected summary output when running coverage reporting with Jest.
This lowers the barrier to troubleshooting this configuration issue since it points to what I would consider the most likely cause of the unexpected output when using this configuration option (an unsupported or malformed glob). Jest doesn't raise any errors in this case which I think is the correct thing to do, but can be hard to debug for newcomers.
Since glob expansion varies across implementations I think it makes sense to explicitly point out this possible misconfiguration and point to the internal dependency's (micromatch) documentation (it is already mentioned in the docs, but I overlooked it multiple times when identifying the problem myself) another callout to those docs could be a good idea to push users to understand the globbing implementation used.
Test plan
Verify the new documentation fits in with the current Jest documentation style.
Get confirmation that this is the best place to point out this possible misconfiguration.