> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/zhcndoc/bun/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate code coverage reports

> Track test coverage with Bun

Bun's test runner can generate code coverage reports.

## Run with Coverage

```bash theme={null}
bun test --coverage
```

## Output Formats

```bash theme={null}
# 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`:

```toml bunfig.toml theme={null}
[test]
coverage = true
coverageThreshold = 80
```

See [Code Coverage](/test/coverage) for complete documentation.
