writing-tests

Guide writing behavior-focused integration tests with real dependencies.

Updated Mar 13, 2026
One-click install
npx skills add https://github.com/kirvin/copilot-cli-essentials --skill writing-tests-kirvin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-tests
Source: https://github.com/kirvin/copilot-cli-essentials/tree/main/plugins/cpe/skills/writing-tests
Command: npx skills add https://github.com/kirvin/copilot-cli-essentials --skill writing-tests-kirvin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you write effective tests that give you confidence in your code's behavior, avoiding common pitfalls and anti-patterns.

Core Features & Use Cases

  • Testing Strategy: Guides you on choosing the right test type (Integration, E2E, Unit) based on the Testing Trophy model.
  • Mocking Guidelines: Provides clear rules on when and what to mock, emphasizing real dependencies.
  • Assertion Best Practices: Offers advice on what to assert for different contexts (UI, API, Library).
  • Use Case: When you're unsure how to test a new feature, use this Skill to get guidance on writing integration tests that verify user-observable behavior with real dependencies.

Quick Start

Use the writing-tests skill to generate a basic integration test structure for a new Python function.

Frequently Asked Questions about writing-tests

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

FAQPage Schema
How do I choose between unit, integration, and e2e tests for my code?

When writing integration tests, you should use real dependencies instead of mocks to verify actual behavior. Mocking guidelines emphasize testing real interactions to achieve high confidence in your code's user-observable behavior.

What is the best way to write a Python integration test for a new function?

When writing tests, you should avoid the anti-pattern of testing mocks themselves. Instead, use real dependencies to verify actual behavior, ensuring your assertions focus on user-observable outcomes rather than mock implementation details.

Does the Testing Trophy model work for TypeScript and React testing?

The Testing Trophy model works for TypeScript and React testing by prioritizing integration tests. This Skill provides language-specific patterns for TypeScript and React to help you write high-confidence tests across these frameworks.

How do I write assertions for UI, API, and library tests?

Writing assertions for UI, API, and library tests requires focusing on user-observable behavior. This Skill offers best practices on what to assert in different contexts, ensuring your tests verify high-confidence outcomes.

When should I avoid mocking dependencies in my test suite?

You should avoid mocking dependencies in most test scenarios to prevent testing mocks instead of behavior. Mocking guidelines suggest using real dependencies primarily, reserving mocks for specific scenarios where external boundaries require isolation.