AgentStack
SKILL verified MIT Self-run

Bun Test Coverage

skill-secondsky-claude-skills-bun-test-coverage · by secondsky

Use for test coverage with Bun, --coverage flag, lcov reports, thresholds, and CI integration.

No reviews yet
0 installs
11 views
0.0% view→install

Install

$ agentstack add skill-secondsky-claude-skills-bun-test-coverage

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Bun Test Coverage? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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

| Reporter | Output | |----------|--------| | text | Console table (default) | | lcov | coverage/lcov.info for CI tools | | json | coverage/coverage.json |

Coverage Thresholds

Set minimum coverage requirements:

# Fail if coverage  {
  console.log(coverage.getCoverageData());
});

Common Errors

| Error | Cause | Fix | |-------|-------|-----| | Coverage threshold not met | Coverage below threshold | Increase test coverage | | No coverage data | Files not executed | Check test includes file | | lcov not found | Missing reporter | Add --coverage-reporter=lcov |

Best Practices

  1. Set realistic thresholds - Start at 60%, increase gradually
  2. Exclude generated files - Mock files, type definitions
  3. Focus on critical paths - Business logic over boilerplate
  4. Run in CI - Prevent coverage regression

When to Load References

Load references/reporters.md when:

  • Custom reporter configuration
  • CI/CD integration details
  • Codecov/Coveralls setup

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.