Test Runner Skill
Run the project's test suite, analyze results, and optionally fix failing tests.
Usage
/test-runner # Run all tests
/test-runner src/auth/ # Run tests for a specific directory
/test-runner --fix # Run tests and fix failures
/test-runner --coverage # Run tests with coverage report
Steps
Detect the test framework Check the project for:
jest.config.*or"jest"in package.json → Jestvitest.config.*→ Vitestpytest.ini,pyproject.toml[tool.pytest] → pytestgo test→ Go testingcargo test→ Rust testing.rspec→ RSpecphpunit.xml→ PHPUnit
Build the test command
- All tests: use the project's test script (
npm test,pytest, etc.) - Specific path: pass the path to the test runner
- Coverage: add the appropriate coverage flag
- Use verbose output when available for better diagnostics
- All tests: use the project's test script (
Run the tests Execute the test command and capture the output.
Analyze the results Parse the output to identify:
- Total tests, passed, failed, skipped
- Which specific tests failed
- Error messages and stack traces
- Coverage percentages (if requested)
Report results
## Test Results ✓ X passed | ✗ X failed | ○ X skipped | Total: X ### Failures - test_name (file:line) — Error: description ### Coverage (if requested) - Statements: X% - Branches: X% - Functions: X% - Lines: X%Fix failures (if --fix flag) For each failing test:
- Read the test file and the source file it tests
- Determine if the issue is in the test or the source code
- If the test is wrong: fix the test
- If the source is wrong: fix the source
- Re-run to verify the fix
- Repeat until all tests pass
Rules
- Always run the existing test command — don't invent your own
- When fixing, prefer fixing source code bugs over changing test expectations
- Never delete or skip failing tests to make the suite pass
- If a test is genuinely outdated, explain why before updating it
- Show the full error output for failures so the user can review
Converted and distributed by TomeVault — claim your Tome and manage your conversions.