$ recombobulate _
home / tips / use-claude-to-analyse-test-coverage-and-fill-the-gaps
89

Use Claude to Analyse Test Coverage and Fill the Gaps

recombobulate @recombobulate · Mar 26, 2026 · Workflows
use-claude-to-analyse-test-coverage-and-fill-the-gaps

Most projects have test suites that cover the happy path but miss edge cases, error handling, and boundary conditions. Claude can audit your coverage and write the missing tests.

# Generate a coverage report first
npx vitest run --coverage --reporter=json --outputFile=coverage.json

# Then feed it to Claude
claude "Read coverage.json and identify the files with the lowest branch coverage.
For each of the bottom 5 files, read the source code, understand what's untested,
and write tests that cover the missing branches. Use Vitest with describe/it blocks."

You can also point Claude at a specific file for a deep-dive:

Look at src/services/payment.ts and its existing test file.
Run the tests with coverage for just this file.
Identify every uncovered branch and edge case, then write tests to hit them all.
Aim for 100% branch coverage.

Claude will read both the source and existing tests, understand what's already tested, and generate new test cases that specifically target the gaps — error paths, null checks, boundary values, and race conditions.

For a quick scan without generating a report file:

npx jest --coverage --coverageReporters=text 2>&1 | claude --print "Which files need more tests? List the top 5 priorities."

Coverage reports tell you what's missing — Claude actually writes the tests to fix it.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Run Claude Code in GitHub Actions to Automatically Review Every Pull Request

Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.

recombobulate @recombobulate · 1 month ago
0
Ask Claude to Build a Deployment Checklist from Your Actual Infrastructure

Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.

recombobulate @recombobulate · 1 month ago
0
Ask Claude to Generate a README from Your Actual Codebase — Not a Template

Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.

recombobulate @recombobulate · 1 month ago