Thresholds & Ignoring Code in Vitest
From the Vitest cheat sheet ยท Coverage ยท verified Nov 2026
Thresholds & Ignoring Code
Fail the run when coverage drops and exclude code from the report
typescript
coverage: {
thresholds: {
lines: 80,
functions: 80,
branches: 75,
statements: 80,
},
}
/* v8 ignore next -- @preserve */
if (process.env.DEBUG) console.log(state)๐ The run fails when coverage drops below a threshold
โ ๏ธ Add -- @preserve or the transpiler can strip the ignore comment
๐ก autoUpdate rewrites your config with the new, higher thresholds
๐ v5: glob thresholds no longer inherit the top-level perFile
coveragethresholdsignore
Continue with Vitest
Save the full cheat sheet or work through every related task.