test-triage
Debugs failing tests, flaky tests, and Node processes that won't exit after tests complete. Use when backend/shared/frontend tests fail or hang.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Test triage
Use this skill when you are asked to:
- Fix a failing test (local or CI).
- Investigate a hanging test run (“tests pass but the process never exits”).
- Identify what’s keeping Node alive (timers, sockets, handles).
Principles
- Logs first: capture the failing command + error output before proposing changes.
- Minimize the reproduction: run the smallest scope that reproduces the failure.
- Fix the root cause (common culprits: long timers without
.unref(), open sockets, background watchers).
Canonical workflows
Backend test runs
Use the wrapper script to run a targeted backend test scope:
-
scripts/run-backend-tests.mjs
Default is unit tests (fast). Use --scope integration or --scope all when required.
“Node won’t exit” / hanging tests
Preferred workflow:
- Re-run the smallest test scope.
- If the process hangs, run the hang-diagnose wrapper:
-
scripts/diagnose-backend-hang.mjs
-
- If you confirm a long-lived timer is the culprit, apply the repo rule:
- Any long
setTimeout/setIntervalmust use.unref()unless explicitly required to keep the process alive.
- Any long
Last reviewed: 2026-01-15
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-01-26
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!