SkillVerified★ Featured
test-generator
Generate unit, integration, and e2e tests for any function or module. Supports Jest, Pytest, Go testing, Rust tests, and Playwright.
Install
anvil skill install test-generatorDocumentation
# test-generator
Generate comprehensive, idiomatic tests for any function, class, module, or API endpoint. test-generator understands your code's intent and produces tests that cover happy paths, edge cases, error conditions, and boundary values — across every major testing framework.
## What It Does
test-generator performs deep code analysis to produce tests that actually matter:
- **Coverage-driven generation**: Analyzes branches, conditions, and return paths to maximize coverage
- **Edge case discovery**: Integer overflows, null/undefined inputs, empty collections, maximum length strings, concurrent access patterns
- **Mock generation**: Auto-generates mocks for external dependencies, HTTP clients, databases, and file system calls
- **Fixture creation**: Generates realistic test data and factory functions based on type signatures
- **Assertion quality**: Uses framework-idiomatic matchers (toBe, assertEqual, assert_eq) with meaningful failure messages
- **Test naming**: Descriptive test names following the "should X when Y" convention
- **Framework detection**: Auto-detects the testing framework in use from package.json, pyproject.toml, Cargo.toml, or go.mod
## Installation
```bash
anvil skill install test-generator
```
## Usage
### Generate Tests for a File
```
/test-generator ./src/auth/jwt.ts
```
### Generate Tests for a Specific Function
```
/test-generator ./src/utils/parser.ts --function parseUserInput
```
### Generate Integration Tests
```
/test-generator ./src/routes/users.ts --type integration
```
### Generate E2E Tests with Playwright
```
/test-generator ./src/pages/Login.tsx --type e2e --framework playwright
```
### Generate Tests with Specific Coverage Target
```
/test-generator ./src/lib/ --coverage 90
```
### Generate for a Python Module
```
/test-generator app/services/auth.py --framework pytest
```
## Supported Frameworks
| Language | Frameworks |
|----------|------------|
| JavaScript/TypeScript | Jest, Vitest, Mocha, Jasmine |
| Python | Pytest, unittest, nose2 |
| Go | testing, testify, ginkgo |
| Rust | cargo test, rstest, proptest |
| E2E | Playwright, Cypress, Selenium |
## Configuration Options
| Option | Description | Default |
|--------|-------------|---------|
| `--type` | unit, integration, e2e | unit |
| `--framework` | Override auto-detected framework | auto |
| `--coverage` | Target coverage percentage | 80 |
| `--mocks` | Mock strategy: auto, manual, none | auto |
| `--output` | Output file path | <file>.test.ts |
| `--watch` | Watch mode: re-generate on source change | false |
## Requirements
- Source file or directory to generate tests for
- Compatible test framework installed in the project
Generate comprehensive, idiomatic tests for any function, class, module, or API endpoint. test-generator understands your code's intent and produces tests that cover happy paths, edge cases, error conditions, and boundary values — across every major testing framework.
## What It Does
test-generator performs deep code analysis to produce tests that actually matter:
- **Coverage-driven generation**: Analyzes branches, conditions, and return paths to maximize coverage
- **Edge case discovery**: Integer overflows, null/undefined inputs, empty collections, maximum length strings, concurrent access patterns
- **Mock generation**: Auto-generates mocks for external dependencies, HTTP clients, databases, and file system calls
- **Fixture creation**: Generates realistic test data and factory functions based on type signatures
- **Assertion quality**: Uses framework-idiomatic matchers (toBe, assertEqual, assert_eq) with meaningful failure messages
- **Test naming**: Descriptive test names following the "should X when Y" convention
- **Framework detection**: Auto-detects the testing framework in use from package.json, pyproject.toml, Cargo.toml, or go.mod
## Installation
```bash
anvil skill install test-generator
```
## Usage
### Generate Tests for a File
```
/test-generator ./src/auth/jwt.ts
```
### Generate Tests for a Specific Function
```
/test-generator ./src/utils/parser.ts --function parseUserInput
```
### Generate Integration Tests
```
/test-generator ./src/routes/users.ts --type integration
```
### Generate E2E Tests with Playwright
```
/test-generator ./src/pages/Login.tsx --type e2e --framework playwright
```
### Generate Tests with Specific Coverage Target
```
/test-generator ./src/lib/ --coverage 90
```
### Generate for a Python Module
```
/test-generator app/services/auth.py --framework pytest
```
## Supported Frameworks
| Language | Frameworks |
|----------|------------|
| JavaScript/TypeScript | Jest, Vitest, Mocha, Jasmine |
| Python | Pytest, unittest, nose2 |
| Go | testing, testify, ginkgo |
| Rust | cargo test, rstest, proptest |
| E2E | Playwright, Cypress, Selenium |
## Configuration Options
| Option | Description | Default |
|--------|-------------|---------|
| `--type` | unit, integration, e2e | unit |
| `--framework` | Override auto-detected framework | auto |
| `--coverage` | Target coverage percentage | 80 |
| `--mocks` | Mock strategy: auto, manual, none | auto |
| `--output` | Output file path | <file>.test.ts |
| `--watch` | Watch mode: re-generate on source change | false |
## Requirements
- Source file or directory to generate tests for
- Compatible test framework installed in the project
Reviews
No reviews yet. Be the first!
Related Skills
SkillVerified★ Featured
v1.0.0vulnapi-scanner
OWASP API Security Top 10:2023 vulnerability scanner. Scan any API for auth bypass, IDOR, SQLi, RCE, rate limiting gaps, JWT vulns, SSRF, and more.
securityowaspapivulnerability
AnvilHub - Official
0Apr 3, 2026
SkillVerified★ Featured
v1.0.0api-gateway
Generate API gateway configurations for Kong, Traefik, nginx, and Apache from OpenAPI specs or conversational descriptions.
apigatewaykongtraefik
AnvilHub - Official
0Apr 3, 2026
SkillVerified★ Featured
v1.0.0commit-review
Analyze staged git changes, generate semantic commit messages, identify issues in diffs, and auto-format conventional commits.
gitcommitreviewconventional-commits
AnvilHub - Official
0Apr 3, 2026