Skip to main content
Bun’s test runner can generate code coverage reports.

Run with Coverage

bun test --coverage

Output Formats

# LCOV format
bun test --coverage --coverage-reporter=lcov

# HTML report
bun test --coverage --coverage-reporter=html

# JSON report
bun test --coverage --coverage-reporter=json

Coverage Thresholds

Set thresholds in bunfig.toml:
bunfig.toml
[test]
coverage = true
coverageThreshold = 80
See Code Coverage for complete documentation.

Build docs developers (and LLMs) love