🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Automatic Test Generator

by @michaelatamuk

Automatically generate unit tests from functions with comprehensive coverage and edge cases

Versionv1.0.0
βš™οΈ 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:

  • βœ… All code paths are covered (if/else, try/catch, loops)
  • βœ… Edge cases are tested (null, empty, boundaries)
  • βœ… Mocks are properly setup and reset
  • βœ… Assertions are specific and meaningful
  • βœ… Test names clearly describe what they test
  • βœ… Setup and teardown are appropriate
  • 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 } } };

    View on ClawHub
    TERMINAL
    clawhub install automatic-test-generator

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’