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

Add help for configuration of collectCoverageFrom #6663

Merged
merged 1 commit into from
Aug 9, 2018

Conversation

AodhanHayter
Copy link
Contributor

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.

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-io
Copy link

Codecov Report

Merging #6663 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e930c70...c2d11fc. Read the comment docs.

@thymikee
Copy link
Collaborator

We've just merged a rollback yesterday and will hopefully patch today. This is however going to be useful for Jest 24

@AodhanHayter
Copy link
Contributor Author

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.

@SimenB
Copy link
Member

SimenB commented Jul 10, 2018

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 listTests, but interactive and for all types

@AodhanHayter
Copy link
Contributor Author

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.

@thymikee thymikee requested a review from SimenB August 8, 2018 20:23
@SimenB SimenB merged commit c0819fc into jestjs:master Aug 9, 2018
@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.

5 participants