Review test quality for a file, directory, or the entire test suite with detailed analysis and improvement recommendations
Analyzes test files for quality, coverage, and reliability issues with actionable improvement recommendations.
/plugin marketplace add C0ntr0lledCha0s/claude-code-plugin-automations/plugin install testing-expert@claude-code-plugin-automations[file-or-directory]Perform a comprehensive quality review of tests, analyzing structure, coverage patterns, reliability, and maintainability.
$1: (Optional) File path or directory to review. If omitted, reviews entire test suite.$ARGUMENTS: Full path or pattern to analyzeWhen this command is invoked with /testing-expert:review-tests [path]:
Discover Tests
**/*.test.{js,ts,jsx,tsx}**/*.spec.{js,ts,jsx,tsx}**/__tests__/**/*.{js,ts,jsx,tsx}**/e2e/**/*.spec.tsIdentify Framework
jest.config.* → Jestplaywright.config.* → Playwrightvitest.config.* → VitestAnalyze Test Quality
Anti-pattern detection patterns:
# Detect potential flaky tests (timing issues)
grep -r "setTimeout\|sleep\|delay" --include="*.test.*" --include="*.spec.*"
# Detect shared mutable state
grep -r "let \w\+ =" --include="*.test.*" | grep -v "beforeEach\|beforeAll"
# Detect missing assertions (empty test bodies)
grep -r "it('\|test('" --include="*.test.*" -A 3 | grep -B 1 "});"
# Detect nested callbacks (potential async issues)
grep -r "\.then(.*\.then(" --include="*.test.*"
# Detect hardcoded timeouts
grep -r "timeout: [0-9]" --include="*.test.*" --include="*.spec.*"
Quality metrics to calculate:
find src -name "*.ts" | wc -l vs test filesGenerate Report
## Test Review Summary
📁 **Scope**: [files reviewed]
🔧 **Framework**: [Jest/Playwright/etc.]
### Quality Score: X/10
#### ✅ Strengths
- [what's done well]
#### ⚠️ Issues Found
- [specific issues with file:line references]
#### 🔧 Recommendations
- [prioritized improvements with examples]
Provide Examples
/testing-expert:review-tests
Reviews entire test suite and provides comprehensive report.
/testing-expert:review-tests src/components
Reviews only tests for components directory.
/testing-expert:review-tests src/utils/parser.test.ts
Deep dive into a specific test file.
The review produces a structured report with: