TestGen Documentation

Everything you need to know to start generating tests with AI

What is TestGen?

FREE BETA

TestGen is a command-line tool that uses artificial intelligence to automatically generate comprehensive unit tests for your code. It supports PHP, JavaScript, and TypeScript, and integrates seamlessly with popular testing frameworks like PHPUnit, Jest, and Vitest.

With TestGen, you can generate high-quality test suites in seconds, allowing you to focus on writing features instead of boilerplate test code. Currently in free beta—join early adopters in shaping the future of AI-powered testing.

Getting Started

1

Create Account

Sign up for a free TestGen account to get started:

• Visit testorix.dev/register

• Enter your name, email, and password

• Click “Create Account”

✓ You're ready to use TestGen!

2

Install the CLI

Install TestGen globally using npm:

npm install -g testgen-cli

You can also use yarn or pnpm if you prefer

3

Login to TestGen

Authenticate the CLI with your email and password:

testgen login
Enter your email: you@example.com
Enter your password: ••••••••
✔ Login successful!

Your credentials will be securely stored locally

4

Generate Tests

Start generating tests for your code:

testgen generate src/UserService.php

✔ Test generated

  tests/UserServiceTest.php
  12 tests • 2.3s

CLI Commands

testgen login

Authenticate with your TestGen account using email and password.

testgen login

testgen generate <file> [options]

Generate unit tests for a specific file with optional flags.

testgen generate src/UserService.php

-o, --output <path>

Specify custom output path for the test file

testgen generate src/utils.js -o tests/custom/utils.test.js

-v, --verbose

Show detailed output including project context, imports, and metrics

testgen generate src/api.ts --verbose

testgen status

View your account information and usage statistics.

testgen status

Running Your Tests

After generating tests, run them with your project's testing framework:

🐘 PHP Projects

./vendor/bin/phpunit

For PHPUnit tests

./vendor/bin/pest

For Pest tests

📜 JavaScript/TypeScript

npm test

Run all tests

npx jest path/to/test.test.js

Run specific test file

Key Features

⚡ Lightning Fast

Generate comprehensive test suites in 2-3 seconds using advanced AI models.

🎯 Smart Metrics

See test count, assertions, and generation time instantly in the CLI output.

🔧 Zero Config

Auto-detects your language, framework, and project structure—works out of the box.

📊 Minimal UI

Clean, distraction-free output by default with verbose mode for detailed info.

Supported Languages

🐘 PHP

Full support for PHP with PHPUnit and Pest

testgen generate UserService.php

📜 JavaScript

Jest and Vitest support for JavaScript

testgen generate utils.js

🔷 TypeScript

Full TypeScript support with Jest and Vitest

testgen generate service.ts

Beta Access & Limits

Free Beta (Current)

20 test generations per month during beta period

No credit card required • Help us improve the product

Premium Features Coming Soon

Join the waitlist at testorix.dev/#beta to be notified when premium accounts launch

Unlimited Generations

No monthly limits on test generation

Multi-file Analysis

Generate tests for entire modules

Smart Mocking

Auto-generate mocks and stubs

Team Collaboration

Share test templates

Need Help?

Having trouble getting started? Here are some quick tips:

  • Make sure you have Node.js 18+ installed
  • Use testgen status to check your remaining quota
  • Use --verbose flag to see detailed project context and metrics
  • Files must be under 500KB to be processed
  • Only .php, .js, .ts, .jsx, and .tsx files are supported