jest-it-up
jest-it-up copied to clipboard
Support for non-global code coverage thresholds
This PR adds support for non-global code coverage thresholds in the form of threshold-keys, which should resolve #13.
Codecov Report
Patch coverage: 100.00% and no project coverage change.
Comparison is base (
66018e5) 100.00% compared to head (1f32256) 100.00%.
Additional details and impacted files
@@ Coverage Diff @@
## master #18 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 69 81 +12
=========================================
+ Hits 69 81 +12
| Impacted Files | Coverage Δ | |
|---|---|---|
| lib/getChanges.js | 100.00% <100.00%> (ø) |
|
| lib/getData.js | 100.00% <100.00%> (ø) |
|
| lib/getNewThresholds.js | 100.00% <100.00%> (ø) |
|
| lib/index.js | 100.00% <100.00%> (ø) |
|
| lib/outputChanges.js | 100.00% <100.00%> (ø) |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@thall90 are you going to complete it?
@rbardini @jimmywarting @vvscode I apologize for the delay - life's been busy, to say the least.
@rbardini I agree that bumping up coverage for all threshold paths by default makes sense. I'll have that change along with all of the requested changes pushed tomorrow 👍
@rbardini While wrapping up changes to this PR, I found what appears to be a pretty big miss in my original changes:
In getNewThresholds we're using the total value from the coverage-summary.json for both global and non-global coverage threshold paths, which doesn't seem right, since Jest only checks coverage for files that match glob provided in the threshold path in non-global cases.
My belief is that we will need to implement similar functionality to Jest's coverage threshold checking in order to verify whether a given threshold path's values should be bumped, since Jest doesn't appear to expose the result of their threshold checks.
Happy to move forward with implementing these changes as well, but I wanted to get your take on the problem and the approach first.
Thanks in advance!
I just implemented some workaround script for my project and it works in a way
- take config
- put 100% coverage limit for all non-global items
- run tests
- analyze output (jest says for every line, that doesn't satisfy expectations what's the current coverage)
- update config with received data