create-unit-test

Generate Jest-compatible unit tests for React/TypeScript source files.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/herren-official/product-agents --skill create-unit-test-herren-official
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-unit-test
Source: https://github.com/herren-official/product-agents/tree/main/skills/b2c-web/create-unit-test
Command: npx skills add https://github.com/herren-official/product-agents --skill create-unit-test-herren-official

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automatically generating unit tests for a codebase saves time and ensures consistent test coverage by analyzing source files and applying project conventions.

Core Features & Use Cases

  • Analyzes given source files (components, hooks, utilities) to determine test targets.
  • Generates Jest-compatible tests with Given-When-Then style where applicable.
  • Saves tests next to the original files with a .test.tsx or .test.ts extension.
  • Use Case: You add a new React component Button.tsx; run this Skill to create Button.test.tsx following your conventions.

Quick Start

Pass the target file path to generate a matching test file in the same directory.

Frequently Asked Questions about create-unit-test

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

FAQPage Schema
How do I automatically generate unit tests for React components in TypeScript?

You can automatically generate unit tests for React components in TypeScript by analyzing source files to create Jest-compatible .test.tsx files using Given-When-Then naming conventions. This process reads your repository structure and writes tests next to the original files.

Can I generate Jest tests that follow Given-When-Then conventions for TypeScript hooks?

Yes, you can generate Jest tests that follow Given-When-Then conventions for TypeScript hooks. The tool analyzes hook source files and creates standard describe blocks in .test.ts files within the same directory.

What's the best way to create unit tests for utilities without manual boilerplate?

The best way to create unit tests for utilities without manual boilerplate is to analyze the utility source files and automatically generate matching test files. This ensures consistent test coverage by applying your project's specific testing conventions.

Does this unit test generation approach work with my existing React and TypeScript project conventions?

Yes, this unit test generation approach works with your existing React and TypeScript project conventions by reading your repository structure and source files. It enforces your project's specific naming and test structure standards.

Where are the generated test files saved when creating unit tests for a React codebase?

Generated test files are saved next to your original source files in the same directories. When you generate tests for Button.tsx, it creates Button.test.tsx in that exact location to maintain a cohesive repository structure.

What source code types are supported for automatic unit test generation in a TypeScript codebase?

Supported source code types for automatic unit test generation in a TypeScript codebase include React components, hooks, and utilities. The tool determines test targets by analyzing these specific source files.