Generate comprehensive tests for specified code
Scanned 9/4/2026
Install to Claude Code
npx -y skills add gabrielmoreira/agent-skills-mirror --skill generate-tests --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Generate Tests?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/gabrielmoreira-generate-tests)More formats (shields.io, HTML) on the badges page.
---
name: generate-tests
description: Generate comprehensive tests for specified code
argument-hint: "<file_or_module> [--framework jest|vitest|pytest]"
effort: medium
when_to_use: "Use when adding test coverage for a function, module, or feature."
disable-model-invocation: true
---
# Generate Tests
Generate comprehensive tests for specified code.
## Instructions
1. Read the target file(s)
2. Identify testable units (functions, classes, methods)
3. Generate tests following project conventions
4. Ensure high coverage of edge cases
## Test Generation Process
### 1. Analyze Target
- Identify public interfaces
- Understand dependencies
- Note edge cases and boundaries
### 2. Detect Test Framework
Check for:
- `jest.config.js` → Jest
- `vitest.config.ts` → Vitest
- `pytest.ini` → pytest
- `mocha` in package.json → Mocha
### 3. Generate Tests
Follow the detected framework conventions.
## Test Categories
### Happy Path
Normal expected behavior with valid input.
### Edge Cases
- Empty inputs
- Null/undefined values
- Boundary values (0, -1, MAX_INT)
- Single item vs multiple items
### Error Cases
- Invalid input types
- Missing required parameters
- Network/IO failures
- Timeout scenarios
### Integration Points
- Database interactions
- External API calls
- File system operations
## Output Format
```typescript
describe('[ComponentName]', () => {
describe('[methodName]', () => {
// Happy path
it('should [expected behavior] when [condition]', () => {
// Arrange
// Act
// Assert
});
// Edge cases
it('should handle empty input', () => {});
it('should handle null values', () => {});
// Error cases
it('should throw when [invalid condition]', () => {});
});
});
```
## Conventions
- One assertion per test (when practical)
- Descriptive test names
- AAA pattern (Arrange-Act-Assert)
- No test interdependence
- Mock external dependencies
## Usage
```
/generate-tests src/utils/calculator.ts
/generate-tests src/services/
```
$ARGUMENTS
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!