Skip to content

Coverage

Easy — everyone uses thisTesting

ELI5 — The Vibe Check

Coverage tells you what percentage of your code is actually tested. 80% coverage means 80% of your lines are touched by at least one test. It sounds great until you realize the untested 20% is where all the bugs live.

Real Talk

Code coverage measures how much of your source code is executed by your test suite. Types include line coverage, branch coverage, function coverage, and statement coverage. High coverage doesn't guarantee correctness — it just means code was executed.

Show Me The Code

# Run tests with coverage report
vitest run --coverage

# Output:
# File         | % Stmts | % Branch | % Funcs | % Lines
# auth.ts      |   92.31 |    87.50 |  100.00 |   92.31

When You'll Hear This

"We require 80% coverage before merging." / "High coverage doesn't mean your tests are actually good."

Made with passive-aggressive love by manoga.digital. Powered by Claude.