Skip to main content
Runs each selected Bun test suite with coverage enabled, parses Bun’s coverage table or lcov.info, and prints modules ranked by failing or lowest coverage. It can also create local issue YAML files for failing or under-covered modules.

Usage

Examples

Measure every module that has a test suite:
Measure one module and show failing suite output:
Use a lower coverage threshold:
Fail when any passing suite stays under the threshold:
Create issue YAML files for coverage problems:

Options

Execution

A measurable module needs a package.json and a tests/ directory. The command runs Bun suites with:
If Bun does not print a coverage table, the command falls back to lcov.info in the module’s configured coverageDir, or coverage/ when no coverageDir is configured.

Output

The report prints one row per run suite, line and function coverage rates, failing suites, and the least-covered files under the threshold. Without --logs, failing suites tell you to re-run with --logs; with --logs, the report includes the tail of each failing suite’s output.

Caching

Coverage entries live in var/cache/coverage/<module>.json. A cached entry is reused only when the module, its workspace dependencies, and selected root files still match. Only suites that reported coverage are stored. --no-cache disables reading and writing the cache.

Issues

With --issues, the command writes one Todo issue into each affected module’s issues/ directory. Failing suites are labeled Bug; under-covered passing suites are labeled Testing.

Exit codes

A failing or errored suite exits non-zero. A passing suite under the threshold exits non-zero only with --strict.