-
-
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
[Bug]: Path coverage thresholds include unexpected files with similar paths #12703
Labels
Comments
j3tan
changed the title
[Bug]: Coverage Thresholds for Path incorrectly include additional paths
[Bug]: Coverage Thresholds for paths incorrectly include additional paths
Apr 20, 2022
j3tan
changed the title
[Bug]: Coverage Thresholds for paths incorrectly include additional paths
[Bug]: Path coverage thresholds include unexpected files with similar paths
Apr 20, 2022
Happy to take a PR fixing this 👍 |
wespickett
added a commit
to wespickett/jest
that referenced
this issue
Apr 21, 2022
wespickett
added a commit
to wespickett/jest
that referenced
this issue
Apr 22, 2022
wespickett
added a commit
to wespickett/jest
that referenced
this issue
Apr 22, 2022
Thanks @wespickett for this fix! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version
27.5.1
Steps to reproduce
npm install
npm test
Expected behavior
I expect to see
src/Foo/
to pass with 100% coverage when using this configuration:The ending
/
in the path group should be respectedActual behavior
I see
src/Foo/
failed with 50% coverage becausesrc/Foobar/
is also aggregated.Additional context
The ending
/
is ignored due to these lines:https://github.com/facebook/jest/blob/fdc74af37235354e077edeeee8aa2d1a4a863032/packages/jest-reporters/src/CoverageReporter.ts#L281-L289
The
path.resolve
removes the ending slash.Using
glob
matcher is not an option here since that checks per-file coverage thresholds instead of the aggregate path style.Environment
The text was updated successfully, but these errors were encountered: