Generate comprehensive unit tests with edge cases and mocks.
---
name: test-generator
description: Generate unit tests with edge cases
version: 1.3.0
---
# Test Generator Skill
Create comprehensive test suites for your code.
## Features
- Analyzes function signatures
- Generates happy path tests
- Adds edge case coverage
- Creates proper mocks
- Follows AAA pattern
## Supported Frameworks
- Jest
- Vitest
- Pytest
- Go testing
- RSpec
## Test Types Generated
### Unit Tests
- Function behavior
- Edge cases
- Error handling
### Integration Tests
- Component interactions
- API endpoints
### Mock Generation
- External dependencies
- Database calls
- API requests
## Output Example
```typescript
describe('calculateTotal', () => {
it('should calculate total with valid items', () => {
const items = [{ price: 10, qty: 2 }, { price: 5, qty: 1 }];
expect(calculateTotal(items)).toBe(25);
});
it('should return 0 for empty array', () => {
expect(calculateTotal([])).toBe(0);
});
it('should handle negative quantities', () => {
const items = [{ price: 10, qty: -1 }];
expect(() => calculateTotal(items)).toThrow();
});
});
```AI Agent Skills are reusable workflow packages that extend your AI coding assistant with multi-step capabilities. Install test-generator by following these steps.
.cursor/skills/ or .codex/skills/ directory