Skip to content
secondsky avatar

Bun Test Coverage

Bun-native test coverage with lcov reports, per-metric thresholds, and CI-ready output configuration.

CCM score
52 of 100
skills.sh installs
427
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers enabling coverage via bun test --coverage, console tables with uncovered line numbers, and reporter selection
  • Includes text, lcov, and json reporters, plus bunfig.toml settings for thresholds, output directories, and exclusion patterns
  • Enforces minimum coverage through --coverage-threshold or per-metric lines, functions, and branches thresholds that fail the run
  • Designed for projects running Bun tests in CI that need lcov output for tools such as Codecov

Install

$ npx -y skills add secondsky/claude-skills --skill bun-test-coverage -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Bun Test Coverage

Bun has built-in code coverage reporting without additional dependencies.

Enabling Coverage

# Enable coverage
bun test --coverage

# With threshold (fail if below)
bun test --coverage --coverage-threshold 80

Configuration in bunfig.toml

[test]
coverage = true
coverageThreshold = 0.8  # 80% minimum
coverageDir = "./coverage"

# Patterns to ignore
coverageSkipTestFiles = true

Coverage Output

------------------|---------|---------|-------------------
File              | % Funcs | % Lines | Uncovered Line #s
------------------|---------|---------|-------------------
All files         |   85.71 |   89.23 |
 src/index.ts     |  100.00 |  100.00 |
 src/utils.ts     |   75.00 |   82.35 | 23-25, 41-43
 src/api.ts       |   80.00 |   85.00 | 67, 89-92
------------------|---------|---------|-------------------

Coverage Reporters

# Default console output
bun test --coverage

# Generate lcov report
bun test --coverage --coverage-reporter=lcov

# Multiple reporters
bun test --coverage --coverage-reporter=text --coverage-reporter=lcov

Available Reporters

Details

Repository
github.com/secondsky/claude-skills
Categories
Testing & QA, DevOps & Cloud
First seen
Jun 3, 2026

Questions

What does the bun-test-coverage skill do?

bun-test-coverage covers test coverage with Bun, using the --coverage flag, lcov reports, coverage thresholds and CI integration. It explains how Bun's built-in coverage reporting works without extra dependencies.

How do I install the bun-test-coverage skill?

Run npx -y skills add secondsky/claude-skills --skill bun-test-coverage -y in a project to install bun-test-coverage. After that, the agent can set up Bun test coverage, thresholds and lcov output for that project.

How do I make bun-test-coverage fail a build when coverage is too low?

bun-test-coverage shows how to pass --coverage-threshold 80 to bun test, or set coverageThreshold in bunfig.toml with per-metric minimums for lines, functions and branches. It also covers writing lcov reports so CI tools such as Codecov can read them.

Where does bun-test-coverage sit among other testing skills?

bun-test-coverage is in the Testing & QA category, next to tdd, webapp-testing and test-driven-development. Unlike those, it focuses on Bun's coverage flag, reporters and thresholds rather than test-writing methods.

More from secondsky/claude-skills

All 116

Similar to Bun Test Coverage

More Testing & QA