Skip to content
Latchkey

Code Coverage Threshold - CI/CD Glossary Definition

A code coverage threshold is a minimum coverage percentage the test suite must meet, enforced in CI so a build fails if coverage drops below the configured bar.

How it is set

In Jest you configure coverageThreshold with per-metric minimums (statements, branches, functions, lines). Tools like Codecov can fail a PR if it lowers coverage compared to the base branch.

Use it carefully

A hard threshold prevents backsliding but can encourage low-value tests written just to hit the number. Pair it with branch coverage and, ideally, a mutation score to measure real assertion quality.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →