π¦ ClawHub
Automatic Test Generator
by @michaelatamuk
Automatically generate unit tests from functions with comprehensive coverage and edge cases
βοΈ Configuration
Specify Testing Framework
"Generate Jest tests for this function"
"Create Vitest tests for this component"
"Write Pytest tests for this Python function"
"Generate Go tests for this package"
Customize Coverage Level
"Generate basic tests with happy path only"
"Create comprehensive tests with all edge cases"
"Write tests for error scenarios only"
Mock Configuration
"Generate tests with Jest mocks for dependencies"
"Create tests using manual mocks"
"Write tests without mocking (integration style)"
π Tips & Best Practices
For Best Results
1. Provide context: Share related code (types, interfaces, dependencies) 2. Specify framework: Mention Jest, Vitest, Pytest, etc. if non-standard 3. Review generated tests: Always verify assertions match business logic 4. Run tests immediately: Ensure they pass before committing 5. Customize as needed: Generated tests are a starting point, refine them 6. Keep functions small: Smaller functions = better test generation
Test Quality Checklist
After generation, verify:
Integration with CI/CD
# package.json
{
"scripts": {
"test": "jest",
"test:coverage": "jest --coverage",
"test:watch": "jest --watch"
}
}Enforce coverage thresholds
jest.config.js
module.exports = {
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80
}
}
};
TERMINAL
clawhub install automatic-test-generator