test-gen

Generate unit tests for functions, classes, and modules from source code.

7|1|Updated Feb 1, 2026
One-click install
npx skills add https://github.com/LvcidPsyche/polymarket-arbitrage-bot --skill test-gen-lvcidpsyche
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-gen
Source: https://github.com/LvcidPsyche/polymarket-arbitrage-bot/tree/main/skills/test-gen
Command: npx skills add https://github.com/LvcidPsyche/polymarket-arbitrage-bot --skill test-gen-lvcidpsyche

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate AI-assisted unit tests from source code.

Core Features & Use Cases

  • Generate tests for functions, classes, and modules across single files or entire directories.
  • Create tests compatible with popular frameworks (Jest, Vitest, Mocha) and provide meaningful assertions.
  • Mocks dependencies automatically to enable robust, isolated testing.

Quick Start

Run npx ai-test-gen ./src/file.ts to generate unit tests for your source file.

Frequently Asked Questions about test-gen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate unit tests for an entire directory of source files?

You can generate unit tests for an entire directory by running the tool against a folder path instead of a single file. It analyzes the source code to produce tests for all functions, classes, and modules found within that directory structure.

Can I use this to generate Jest tests and automatically mock dependencies?

Yes, it supports configurable frameworks including Jest, Vitest, and Mocha. It analyzes your code to automatically mock dependencies, enabling robust and isolated unit testing for your modules.

Does this AI test generation tool work with Vitest and Mocha configurations?

Yes, the AI test generation works with Vitest and Mocha configurations. It analyzes your source files and generates meaningful assertions compatible with these popular testing frameworks.

What is the best way to create meaningful assertions for complex modules?

The best way to create meaningful assertions for complex modules is to use AI-assisted generation. It analyzes your source code logic and produces targeted assertions while automatically mocking any external dependencies.

How do I get test coverage for existing functions without writing tests manually?

You can get test coverage for existing functions by running a single command to analyze your source code. The tool generates unit tests for your functions and classes automatically, reducing manual effort.

Are there limitations when mocking dependencies for isolated unit tests?

While it automatically mocks dependencies for isolated unit tests, complex or highly dynamic imports may require manual adjustments. The generated tests provide a strong baseline but might need refinement for edge cases.