Istanbul / lcov provides a way to define min/med values to correspond to the red/yellow/green visual clues.
This is done via settings in a .lcovrc file:
https://www.systutorials.com/docs/linux/man/5-lcovrc/
https://stackoverflow.com/questions/40618939/lcov-html-report-coverage-limits
Jest allows us to define custom coverage thresholds using --coverageThreshold CLI argument/config file setting.
The coloration of the lcov HTML report should follow these values and not color a missed threshold green.
We've set our global thresholds to 100%:
coverageThreshold: {
global: {
// 100%!
branches: 100,
functions: 100,
lines: 100,
// no uncovered statements!
statements: 0,
},
},
But (outside of the CLI) we have to painstakingly scan our coverage report to find that one 98.72% miss:

Some possible solutions:
We realize that Jest's coverageThreshold is more granular, allowing for global and per-glob overrides, but at least mapping the global lines/branches/functions to lcov's genhtml_hi_limit/genhtml_branch_hi_limit/genhtml_function_hi_limit would be a big improvement.
.lcovrc support?Allow a discoverable .lcovrc (this would allow the use of _all_ lcov config options). Start discovery in package root or sibling to config.js? Or add an --lcovConfig arg alongside --config/-c?
Since the coverageThreshold setting is a core setting, and not only supported by a custom reporter, we feel that this belongs here.
@nemoDreamer you can use .istanbul.yml for this purpose.
For Example:
reporting:
watermarks:
statements: [50, 100]
lines: [50, 100]
functions: [50, 100]
branches: [50, 100]
Where the firs value is top border for low coverage and the second one is bottom border for high coverage.
I think we can fold this into #4103 - it's basically "configure coverage reporter".
Most helpful comment
@nemoDreamer you can use
.istanbul.ymlfor this purpose.For Example:
Where the firs value is top border for low coverage and the second one is bottom border for high coverage.