test-generator

Generates basic unit test scaffolding for new functions and components across JavaScript, Python, Java, and Go frameworks.

763|165|Updated Sep 16, 2025
One-click install
npx skills add https://github.com/alirezarezvani/claude-code-tresor --skill test-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-generator
Source: https://github.com/alirezarezvani/claude-code-tresor/tree/main/skills/development/test-generator
Command: npx skills add https://github.com/alirezarezvani/claude-code-tresor --skill test-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation of basic test scaffolding for new functions and components, saving you the initial setup time for testing. It helps ensure that new code has immediate test coverage, promoting better code quality and reducing the likelihood of bugs.

Core Features & Use Cases

  • Intelligent Test Scaffolding: Automatically detects new code and generates basic unit tests, including happy paths and common edge cases.
  • Framework-Aware: Adapts to your project's testing framework (Jest, Vitest, pytest, JUnit, etc.).
  • Use Case: You write a new JavaScript function calculateDiscount(price, percentage). The skill instantly generates a describe block with it statements for successful calculation, invalid price errors, and zero percentage, complete with expect assertions.

Quick Start

The skill activates automatically when new functions or components are written.

Create a new JavaScript function:

function calculateTotal(items) { return items.reduce((sum, item) => sum + item.price, 0); }

The skill will then suggest or generate a basic test file for it.

Frequently Asked Questions about test-generator

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

FAQPage Schema
How do I auto-generate unit tests for new JavaScript functions?

Auto-generate unit tests by writing new functions; the Skill detects them and creates test scaffolding with happy-path cases, edge cases, and error scenarios in Jest, Vitest, or Mocha syntax, ready to run.

What testing frameworks does test generation support?

Test generation adapts to Jest, Vitest, and Mocha for JavaScript; pytest and unittest for Python; JUnit for Java; and the testing package for Go, applying framework-appropriate syntax automatically.

Can I generate tests for existing code without rewriting it?

Yes. The Skill generates tests for missing test files alongside existing functions and components, letting you add coverage to code already in place without modifying the source.

What does generated test scaffolding include?

Generated scaffolding includes happy-path test cases, null and edge-case handling, simple error scenarios, framework-appropriate assertions, and TODO notes flagging complex cases that need manual refinement.

Does test generation work for components as well as functions?

Yes. The Skill generates test scaffolding for both new functions and new components, detecting either when written and producing basic unit tests with the same coverage patterns.