AI-powered test generator with framework support, pattern detection, and React Testing Library integration
npm install testgenie-aiAI-powered CLI test generator that creates comprehensive test suites for your JavaScript/TypeScript projects in seconds.
Generate high-quality, maintainable test files using advanced AI models. TestGenie analyzes your code structure, detects patterns, and creates thorough test coverage automatically.
- โจ Features
- ๐ Quick Start
- ๐ Commands
- ๐งช Test Framework
- ๐จ Test Styles
- ๐ค AI Providers
- โ๏ธ Configuration
- ๐ง Requirements
- ๐ฏ Examples
- โ FAQ
- ๐ค Contributing
- ๐ License
- ๐โโ๏ธ Support
- Smart Code Analysis: Automatically detects functions, patterns, and dependencies
- Multi-Provider Support: OpenAI, Google Gemini, Anthropic Claude, or TestGenie API
- Comprehensive Test Generation: Creates thorough test suites with edge cases
- Advanced Async Analysis: Understands Promise flows, timing, and error handling
- React Component Intelligence: Detects JSX/TSX and generates proper React tests
- Behavioral Understanding: Analyzes component validation, form logic, and user flows
- Lightning Fast: Generate complete test suites in seconds
- Multiple Test Styles: BDD, TDD, minimal, and verbose options
- Framework Support: Jest (Mocha and Vitest coming soon!)
- Git Integration: Generate tests for changed files or specific commits
- Automatic Setup: Auto-installs dependencies and creates Jest configuration
- React/JSX Support: Full React Testing Library integration with automatic detection
- Test Coverage Analysis: Scans projects and identifies untested code
- Flexible Configuration: Customize test directories, patterns, and coverage thresholds
- Audit & Recommendations: Comprehensive coverage reports with actionable insights
- Test Execution: Built-in test runner with multiple reporters and coverage options
``bash`
npm install -g testgenie-aior
yarn global add testgenie-aior
pnpm add -g testgenie-aior
bun add -g testgenie-ai
`bash`
testgenie init
This interactive setup will configure:
- Test Framework: Jest (currently supported)
- Test Style: BDD, TDD, minimal, or verbose
- AI Provider: Choose from multiple providers
- Test Directory: Where to generate test files
- Coverage Settings: Minimum coverage thresholds
`bashGenerate tests for a specific file
testgenie gen src/utils/helper.ts
$3
`bash
Run all tests with automatic setup
testgenie testRun tests with coverage report
testgenie test --coverageWatch mode for development
testgenie test --watch
`$3
`bash
testgenie --help
`Get comprehensive help for all available commands and options.
$3
`bash
1. Initialize project
testgenie init2. Scan for files needing tests
testgenie scan3. Generate tests for specific files
testgenie gen src/components/Button.tsx4. Auto-generate tests for uncovered files
testgenie audit --fix5. Run tests with automatic setup
testgenie test --coverage6. Continuous development with watch mode
testgenie test --watch
`---
๐ Commands
$3
Initialize or update configuration file.
Options:
-
--force, -f: Overwrite existing configurationExample:
`bash
testgenie init --force
`$3
Generate comprehensive test files.
Arguments:
-
file: Specific file to generate tests forOptions:
-
--diff, -d: Generate tests for uncommitted git changes
- --since, -s : Generate tests for changes since commit
- --style