writing-tests

Write behavior-focused integration and E2E tests with real dependencies.

5|Updated Mar 16, 2019
One-click install
npx skills add https://github.com/third774/dotfiles --skill writing-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-tests
Source: https://github.com/third774/dotfiles/tree/main/opencode/skill/writing-tests
Command: npx skills add https://github.com/third774/dotfiles --skill writing-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill articulates a Testing Trophy model to write behavior-focused tests with real dependencies.

Core Features & Use Cases

  • Testing Trophy Model: Integration, E2E, Unit hierarchy.
  • Real Dependencies: Emphasizes avoiding mocks for reliable tests.
  • Anti-Patterns: Warns against common testing pitfalls.

Quick Start

Start by writing a failing integration test and then implement minimal code to pass.

Frequently Asked Questions about writing-tests

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

FAQPage Schema
How do I write integration tests that use real dependencies instead of mocks?

Integration tests with real dependencies verify actual behavior across system components. This Skill teaches the Testing Trophy model, emphasizing integration tests as the primary layer where you test real workflows without mocking internal logic, ensuring production-like conditions and catching integration failures that mocks hide.

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

The Testing Trophy hierarchy prioritizes integration tests (primary), followed by end-to-end tests (secondary), then unit tests (rare). Integration tests verify real dependencies; E2E tests validate complete user workflows; unit tests focus on pure functions. This approach maximizes confidence while minimizing brittle, over-mocked tests.

How do I start writing behavior-driven tests?

Begin by writing a failing integration test that describes the behavior you want, then implement minimal code to pass it. This test-first approach with real dependencies ensures your tests drive realistic, production-ready implementations rather than testing mock implementations.

What testing anti-patterns should I avoid?

Avoid mocking internal logic, which creates false confidence and hides real integration failures. The Skill identifies common pitfalls that compromise test reliability and explains why real-dependency testing maintains production integrity better than heavily mocked test suites.

Can I use real dependencies for unit tests?

Real dependencies are rare in unit testing but valuable for pure functions. This Skill emphasizes selective unit testing with real dependencies only where meaningful, keeping most unit tests isolated while reserving real dependencies for integration and end-to-end layers where they provide maximum value.

How do I verify my tests cover the right workflows?

The Skill provides a pre-test workflow and progress checklist to ensure your integration tests validate functional requirements and real-world scenarios. This structured approach confirms tests enforce production behavior with real dependencies rather than testing isolated mock interactions.