Pass the
--coverage
flag to bun test
to enable this feature. This will print a coverage report after the test run.
The coverage report lists the source files that were executed during the test run, the percentage of functions and lines that were executed, and the line ranges that were not executed during the run.
terminal
To always enable coverage reporting by default, add the following line to your
bunfig.toml
:
bunfig.toml
Refer to Docs > Test runner > Coverage for complete documentation on code coverage reporting in Bun.