testing

Create unit, integration, and end-to-end test suites across languages and frameworks.

53|1|Updated Dec 18, 2025
One-click install
npx skills add https://github.com/cosmix/claude-code-setup --skill testing-cosmix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/cosmix/claude-code-setup/tree/main/skills/testing
Command: npx skills add https://github.com/cosmix/claude-code-setup --skill testing-cosmix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps you create comprehensive test suites including unit, integration, and end-to-end testing strategies to prevent regressions and ensure software quality.

Core Features & Use Cases

  • Unit, Integration, and E2E Testing: Tailor testing levels across languages and frameworks.
  • Test Strategy & Coverage: Plan coverage targets and mock data.
  • Use Case: Suppose you have a component library; generate tests that cover public APIs and edge cases, producing a uniform test suite.

Quick Start

Create a basic Python unit test suite using pytest for a module named math_utils and run the tests.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I write unit tests with pytest for Python modules?

Unit tests with pytest isolate individual functions or methods using AAA-pattern tests (arrange, act, assert). Create test files prefixed with `test_`, define test functions, and run `pytest` to execute them. pytest handles fixture setup, parameterization, and mocking through built-in decorators, making it the standard for Python unit testing.

What's the difference between unit, integration, and end-to-end tests?

Unit tests verify individual functions in isolation; integration tests check how components work together; end-to-end tests validate complete workflows from user input to output. Each tests at a different scope: unit tests are fast and deterministic, integration tests catch cross-module issues, and e2e tests confirm the system works as a whole.

How do I mock external dependencies in my tests?

Mocking replaces real external services, APIs, or database calls with controlled fake implementations. Use pytest fixtures combined with mocking libraries to define mock behavior, control return values, and verify interactions. This ensures tests run fast, deterministically, and independently without requiring actual external services.

Can I test async operations and handle timeouts in my test suite?

Yes. Testing frameworks support async test functions and provide timeout mechanisms to catch hanging operations. Define async fixtures and test functions, configure timeout values for long-running tasks, and use event-loop handling to manage concurrent operations while keeping tests deterministic and edge-case coverage clear.

How do I measure and target test coverage across my project?

Test coverage tracks what percentage of your code is exercised by tests. Use coverage tools to identify untested lines, set coverage targets (typically 70–90%), and prioritize testing high-risk areas like public APIs and edge cases. Coverage reports guide strategy and ensure regressions are caught consistently.

What's the best approach to test a component library with multiple frameworks?

Design tests around public interfaces and contract requirements rather than implementation details. Create framework-agnostic test strategies using fixtures to mock dependencies, then apply language and framework-specific test tools (pytest for Python, Jest for JavaScript) to generate uniform test suites covering edge cases and API contracts.