Bun Set a Code Coverage Threshold with the Bun Test Runner

Set a code coverage threshold with the Bun test runner

9 stars 1 forksTesting & QA

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add jarle/bun-skills --skill Bun Set a code coverage threshold with the Bun test runner
Manual install
git clone --depth 1 https://github.com/jarle/bun-skills.git /tmp/bun-skills
mkdir -p ~/.claude/skills
cp -r /tmp/bun-skills/skills/bun-guides-test-coverage-threshold ~/.claude/skills/Bun-Set-a-code-coverage-threshold-with-the-Bun-test-runner

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Set a code coverage threshold with the Bun test runner

Bun's test runner supports built-in code coverage reporting via the `--coverage` flag.

```sh terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
bun test --coverage
```

```txt  theme={"theme":{"light":"github-light","dark":"dracula"}}
test.test.ts:
✓ math > add [0.71ms]
✓ math > multiply [0.03ms]
✓ random [0.13ms]
-------------|---------|---------|-------------------
File         | % Funcs | % Lines | Uncovered Line #s
-------------|---------|---------|-------------------
All files    |   66.67 |   77.78 |
 math.ts     |   50.00 |   66.67 |
 random.ts   |   50.00 |   66.67 |
-------------|---------|---------|-------------------

 3 pass
 0 fail
 3 expect() calls
```

***

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.

```toml bunfig.toml icon="settings" theme={"theme":{"light":"github-light","dark":"dracula"}}
[test]
# 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.

```sh terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
bun test --coverage
```

```txt  theme={"theme":{"light":"github-light","dark":"dracula"}}
<test output>
$ echo $?
1 # this is the exit code of the previous command
```

***
Read the full skill on GitHub

Details

Skill name
Bun Set a code coverage threshold with the Bun test runner
Path
skills/bun-guides-test-coverage-threshold/SKILL.md
License
MIT
Repo updated
24 February 2026

FAQ

What does the Bun Set a Code Coverage Threshold with the Bun Test Runner skill do?

Set a code coverage threshold with the Bun test runner

How do I install the Bun Set a Code Coverage Threshold with the Bun Test Runner skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add jarle/bun-skills --skill Bun Set a code coverage threshold with the Bun test runner. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Bun Set a Code Coverage Threshold with the Bun Test Runner popular?

It lives in jarle/bun-skills, which has 9 GitHub stars and 1 forks.

Related skills

Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.