Files
FoundryVTT/.claude/commands/test.md
2025-11-06 14:04:48 +01:00

46 lines
1.3 KiB
Markdown

---
description: Generate and run tests for code - creates comprehensive test suites
allowed-tools: Read(*), Write(*), Grep(*), Glob(*), Bash(*)
argument-hint: [file-or-path]
---
# Test Command
Generate comprehensive tests or run existing tests.
## Technology Adaptation
**Configuration Source**: [CLAUDE.md](../../CLAUDE.md)
Consult CLAUDE.md for:
- **Test Framework**: (xUnit, Jest, pytest, JUnit, Go test, Rust test, etc.)
- **Test Command**: How to run tests
- **Test Location**: Where tests are stored
- **Coverage Tool**: Code coverage command
## Instructions
1. **Read CLAUDE.md** for test framework and patterns
2. **Determine Action**
- If code file in $ARGUMENTS: Generate tests for it
- If test file in $ARGUMENTS: Run that test
- If directory in $ARGUMENTS: Run all tests in directory
- If no argument: Run all project tests
3. **For Test Generation**
- Analyze code to identify test cases
- Generate tests covering happy paths, edge cases, errors
- Follow CLAUDE.md test patterns
- Use test-engineer agent for complex scenarios
4. **For Test Execution**
- Use test command from CLAUDE.md
- Display results clearly
- Show coverage if available
## MCP Usage
- **serena**: `find_symbol` to analyze code structure
- **context7**: `get-library-docs` for testing best practices