| name | test |
| description | Test generation and test running command. Creates and executes tests for code. |
/test - Test Generation and Execution
$ARGUMENTS
Purpose
This command generates tests, runs existing tests, or checks test coverage.
Sub-commands
/test - Run all tests
/test [file/feature] - Generate tests for specific target
/test coverage - Show test coverage report
/test watch - Run tests in watch mode
Behavior
Generate Tests
When asked to test a file or feature:
-
Analyze the code
- Identify functions and methods
- Find edge cases
- Detect dependencies to mock
-
Generate test cases
- Happy path tests
- Error cases
- Edge cases
- Integration tests (if needed)
-
Write tests
- Use project's test framework (Jest, Vitest, etc.)
- Follow existing test patterns
- Mock external dependencies
Output Format
For Test Generation
## 🧪 Tests: [Target]
### Test Plan
| Test Case | Type | Coverage |
|-----------|------|----------|
| Should create user | Unit | Happy path |
| Should reject invalid email | Unit | Validation |
| Should handle db error | Unit | Error case |
### Generated Tests
`tests/[file].test.ts`
[Code block with tests]
---
Run with: `npm test`
For Test Execution