Skip to content
Back to skills

Debug Failing Test

ASecurity

Systematic process for diagnosing and fixing a failing test

  • 60 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 12, 2026
ai-agents

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add albinotonnina/echos --skill debug-failing-test --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Debug Failing Test?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Debug Failing Test
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/albinotonnina-debug-failing-test/badge)](https://www.skillsdirectory.com/skills/albinotonnina-debug-failing-test)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: debug-failing-test
description: Systematic process for diagnosing and fixing a failing test
disable-model-invocation: true
---

Follow this order before changing any application code:

1. **Reproduce in isolation**
   Run only the failing test and confirm it fails reliably (not intermittently).

2. **Read the full error output**
   Do not skim — read the assertion failure, the stack trace, and any stderr output.
   Note the exact line number in the test and in the source.

3. **Check for environment issues**
   - Is the test DB seeded?
   - Are required env vars set in `.env.test`?
   - Is there leftover state from a previous test run?

4. **Trace the failure**
   Add a single `console.log` at the point of failure to inspect the actual value.
   Do not add multiple logs at once — add one, run, interpret, then add the next.

5. **Identify the root cause**
   Is the test wrong (wrong expectation), the fixture wrong (bad test data), or the code wrong?
   Fix the right thing — do not change a test expectation just to make it pass.

6. **Verify the fix**
   Run the full test suite after fixing.
   If the fix touches shared utilities, check for regressions in related tests.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…