rembrembdocs

to require 90% line-level and function-level coverage

coverageThreshold = 0.9


* * *

If your test suite does not meet this threshold, `bun test` will exit with a non-zero exit code to signal a failure.

terminal

bun test --coverage

<test output> $ echo $? 1 # this is the exit code of the previous command ```

Different thresholds can be set for line-level and function-level coverage.

bunfig.toml

[test]
# to set different thresholds for lines and functions
coverageThreshold = { lines = 0.5, functions = 0.7 }

See Docs > Test runner > Coverage for complete documentation on code coverage reporting in Bun.

Was this page helpful?

Suggest editsRaise issue

[

Generate code coverage reports with the Bun test runner

Previous

](../coverage/index.md)[

Selectively run tests concurrently with glob patterns

Next

](../concurrent-test-glob/index.md)