Bun’s test runner supports built-in code coverage reporting via theDocumentation Index
Fetch the complete documentation index at: https://bun.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
--coverage flag.
terminal
To set a minimum coverage threshold, add the following line to your
bunfig.toml. This requires that 90% of your codebase is covered by tests.
bunfig.toml
If your test suite does not meet this threshold,
bun test will exit with a non-zero exit code to signal a failure.
terminal
Different thresholds can be set for line-level and function-level coverage.
bunfig.toml
See Docs > Test runner > Coverage for complete documentation on code coverage reporting in Bun.