npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

testgen-cli

v0.1.9

Published

AI-powered unit test generation CLI tool for PHP, JavaScript, and TypeScript

Downloads

1,079

Readme

TestGen CLI

AI-powered test generation for PHP, JavaScript, and TypeScript. Generate comprehensive unit tests with a single command.

npm version License

Demo


✨ No Login Required - Start Generating Tests Instantly!

You can now generate tests without creating an account or logging in. Just install and start testing!


Quick Start

# 1. Install globally
npm install -g testgen-cli

# 2. Generate tests (no login required!)
testgen generate src/your-file.js

That's it! Start generating tests immediately without any authentication.

Want early access to premium features?Create an account


Features

  • 🤖 AI-Powered - Generates intelligent test cases with edge cases
  • 🌐 Multi-Language - PHP (PHPUnit/Pest), JavaScript (Jest), TypeScript (Jest)
  • Fast - Tests generated in seconds
  • 🎨 Review Before Save - See a diff and approve changes
  • 📊 Smart Output - Clean minimal mode, verbose mode with --verbose

Installation Options

Option 1: Global (Recommended)

Install once, use in any project - no login required:

npm install -g testgen-cli

Now you can use testgen anywhere:

cd ~/my-project
testgen generate src/api/users.js

cd ~/another-project
testgen generate app/Models/User.php

Option 2: Project-Specific

Install in your project as a dev dependency:

npm install --save-dev testgen-cli

Use with npx:

npx testgen generate src/components/Button.tsx

Or add to your package.json:

{
  "scripts": {
    "test:generate": "testgen generate"
  }
}
npm run test:generate src/utils/helpers.js

Option 3: Run Without Installing (Instant Start!)

npx testgen generate src/your-file.ts

Note: First run downloads the package temporarily - no account needed!


Usage Examples

Generate Test for PHP File

testgen generate app/Services/PaymentService.php

Output: tests/Unit/Services/PaymentServiceTest.php

Generate Test for JavaScript File

testgen generate src/utils/formatters.js

Output: src/utils/formatters.test.js

Generate Test for TypeScript File

testgen generate src/hooks/useAuth.ts

Output: src/hooks/useAuth.test.ts

Custom Output Location

testgen generate src/api.js --output tests/integration/api.test.js

See Detailed Generation Info

testgen generate src/calculator.ts --verbose

Commands

testgen generate <file>    # Generate test for a file (no login required!)
testgen login              # (Optional) Login for premium features
testgen status             # Check your usage quota (requires login)
testgen --help             # Show help
testgen --version          # Show version

Generate Command Options

testgen generate <file> [options]

Options:
  -o, --output <path>    Custom output path for test file
  -v, --verbose          Show detailed generation information

Supported Languages

| Language | Test Framework | File Extensions | Output Location | | ---------- | -------------- | --------------- | ----------------------------- | | PHP | PHPUnit, Pest | .php | tests/Unit/YourFileTest.php | | JavaScript | Jest | .js, .jsx | your-file.test.js | | TypeScript | Jest | .ts, .tsx | your-file.test.ts |

Limits:

  • File size: 0.5MB max
  • Without login: Limited tests (managed by backend)
  • With free account: 10 tests per month
  • Premium: Early access to premium features

Common Issues

"Authentication failed"

This only happens if you're logged in. Run login again:

testgen login

Or simply use without login - no authentication required!

"Monthly limit reached"

You've used your quota. Create an account or join waitlist for more.

"Command not found: testgen"

If globally installed but command not found:

npm install -g testgen-cli

Or use without installing:

npx testgen-cli generate src/file.js

"File too large"

Maximum file size is 0.5MB. Split large files into smaller modules.


What You Get

✅ Comprehensive test coverage ✅ Smart assertions and edge cases ✅ Framework-specific best practices ✅ Mocking and dependency injection ✅ Tests that actually run ✅ No login required - Start testing immediately!

Anonymous usage: Limited tests (backend-managed) Free account: 10 tests/month Premium: Early access to premium features - Join the waitlist


Links


License: Elastic License 2.0