unit-test-generator

Generate AAA-pattern unit tests with Vitest or Jest compatibility.

5|Updated Dec 31, 2025
One-click install
npx skills add https://github.com/patricio0312rev/skillset --skill unit-test-generator-patricio0312rev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unit-test-generator
Source: https://github.com/patricio0312rev/skillset/tree/main/templates/testing/unit-test-generator
Command: npx skills add https://github.com/patricio0312rev/skillset --skill unit-test-generator-patricio0312rev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires fs, path, and includes scripts (resource) components.

What problem does it solve?

Generates comprehensive unit tests with the AAA pattern (Arrange-Act-Assert), including edge cases, error scenarios, and coverage analysis. Creates test files that mirror your source structure to ease maintenance and ensure consistent test scaffolding. This helps teams accelerate test creation and improve test quality.

Core Features & Use Cases

  • AAA-pattern test scaffolding that enforces structured, readable test suites.
  • Comprehensive edge-case and error-case coverage to strengthen resilience.
  • Mirrored source structure for intuitive test organization and navigation.
  • Included test-generation script (scripts/generate-tests.ts) to automate boilerplate creation.
  • Compatible with Vitest or Jest test runners and standard TypeScript projects.

Quick Start

Run the unit-test-generator against your source code to generate full test suites that mirror the project layout.

Frequently Asked Questions about unit-test-generator

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

FAQPage Schema
How do I auto-generate unit tests with the AAA pattern for a TypeScript codebase?

You can auto-generate unit tests with the AAA pattern by running a generation script against your source baseline. This script scaffolds comprehensive test suites that cover edge cases and mirror your source directory structure for Vitest or Jest.

Can I use this test generation approach with both Vitest and Jest?

Yes, the test generation approach is compatible with both Vitest and Jest test runners. It outputs ready-to-run test file templates using standard TypeScript, ensuring your generated test suites integrate seamlessly with either framework.

How do I ensure generated test suites cover edge cases and error scenarios?

To ensure generated test suites cover edge cases and error scenarios, the automated test generation enforces the Arrange-Act-Assert pattern and systematically scaffolds comprehensive error-case coverage, strengthening the resilience of your source baseline.

What is the best way to organize test files to mirror my source directory structure?

The best way to organize test files to mirror your source directory structure is through automated generation. The script creates test files that reflect your source baseline layout, easing maintenance and ensuring intuitive test organization and navigation.

Do I need a specific script to automate test boilerplate creation for my project?

Yes, you need a generation script located in scripts/generate-tests.ts to automate test boilerplate creation. This script scaffolds the test files and organizes them according to your project's source directory structure.

Why does unit test generation require a source baseline before scaffolding test suites?

Unit test generation requires a source baseline because the generation script reads your existing codebase structure to output test files that accurately mirror the source layout. This ensures the generated tests target the correct modules and paths.