generating-unit-tests

Solid

This skill enables Claude to automatically generate comprehensive unit tests from source code. It is triggered when the user requests unit tests, test cases, or test suites for specific files or code snippets. The skill supports multiple testing frameworks including Jest, pytest, JUnit, and others, intelligently detecting the appropriate framework or using one specified by the user. Use this skill when the user asks to "generate tests", "create unit tests", or uses the shortcut "gut" followed by a file path.

Testing & QA 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

## Overview This skill empowers Claude to rapidly create robust unit tests, saving developers time and ensuring code quality. It analyzes source code, identifies key functionalities, and generates test cases covering various scenarios, including happy paths, edge cases, and error conditions. ## How It Works 1. **Analyze Source Code**: The skill analyzes the provided source code file to understand its functionality, inputs, and outputs. 2. **Determine Testing Framework**: The skill either detects the appropriate testing framework based on the file type and project structure or uses the framework specified by the user. 3. **Generate Test Cases**: The skill generates comprehensive test cases, including tests for valid inputs, invalid inputs, boundary conditions, and error scenarios. 4. **Create Mock Dependencies**: The skill automatically creates mocks and stubs for external dependencies to isolate the code being tested. 5. **Output Test File**: The skill outputs a new test file containing the generated test cases, imports, setup, and assertions. ## When to Use This Skill This skill activates when you need to: - Create unit tests for a specific file or code snippet. - Generate test cases for a function, class, or module. - Quickly add test coverage to existing code. - Ensure code quality and prevent regressions. ## Examples ### Example 1: Generating Tests for a JavaScript Utility Function User request: "generate tests src/utils/validator.js" The skill will: 1. Analyze t...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Listed

test-generator

Generate unit tests based on existing code patterns and testing frameworks.

335 Updated today
aiskillstore
Testing & QA Solid

automating-api-testing

This skill automates API endpoint testing, including request generation, validation, and comprehensive test coverage for REST and GraphQL APIs. It is used when the user requests API testing, contract testing, or validation against OpenAPI specifications. The skill analyzes API endpoints and generates test suites covering CRUD operations, authentication flows, and security aspects. It also validates response status codes, headers, and body structure. Use this skill when the user mentions "API testing", "REST API tests", "GraphQL API tests", "contract tests", or "OpenAPI validation".

2,266 Updated today
jeremylongshore
AI & Automation Solid

generating-test-doubles

This skill uses the test-doubles-generator plugin to automatically create mocks, stubs, spies, and fakes for unit testing. It analyzes dependencies in the code and generates appropriate test doubles based on the chosen testing framework, such as Jest, Sinon, or others. Use this skill when you need to generate test doubles, mocks, stubs, spies, or fakes to isolate units of code during testing. Trigger this skill by requesting test double generation or using the `/gen-doubles` or `/gd` command.

2,266 Updated today
jeremylongshore
Testing & QA Featured

unit-testing-test-generate

Generate comprehensive, maintainable unit tests across languages with strong coverage and edge case focus.

39,227 Updated today
sickn33
Testing & QA Listed

unit-testing-test-generate

Generate comprehensive, maintainable unit tests across languages with strong coverage and edge case focus.

335 Updated today
aiskillstore