testing

Test effectful TypeScript code by substituting test layers for mocks.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/aitchwhy/dotfiles --skill testing-aitchwhy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/aitchwhy/dotfiles/tree/main/config/quality/generated/skills/testing
Command: npx skills add https://github.com/aitchwhy/dotfiles --skill testing-aitchwhy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Emphasizes TDD with Effect layers, using test layers instead of mocks.

Core Features & Use Cases

  • Layer-based testing
  • Self-contained test environments

Quick Start

Write a failing test, implement enough code to pass, and refactor.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I test effectful code without mocking frameworks?

Layer-based testing substitutes test layers instead of mocks. Build test doubles as Layer implementations, compose them with Layer.mergeAll, and run tests via Effect.runPromiseExit to assert on Exit outcomes. This approach works with TypeScript projects using typed effects.

Can I use test layers with Effect to test repository interactions?

Yes. Test layers enable testing repository interactions, error paths, and business flows like createOrder by substituting Layer implementations in self-contained test environments without external dependencies.

What's the difference between layer-based testing and traditional mocks?

Layer-based testing composes test doubles as full Layer implementations within Effect's type system, replacing real services end-to-end. Traditional mocks typically stub individual functions. Layers provide stronger composition guarantees and integrate naturally with Effect's dependency model.

How do I structure a test-driven workflow with Effect layers?

Write a failing test first, implement enough code to pass, then refactor. Use Layer to build both production and test service implementations, then merge them with Layer.mergeAll and run via Effect.runPromiseExit to verify Exit outcomes.

What TypeScript knowledge do I need for Effect layer testing?

Familiarity with typed effects, Layer utilities, and TypeScript generics is required. Understanding how to compose layers and interpret Exit types—Success or Failure outcomes—enables building and asserting on test flows.

Can layer-based testing handle complex error paths?

Yes. Test layers let you implement error cases explicitly within Layer definitions, then compose and run them through Effect.runPromiseExit. You can assert on both success and failure Exit outcomes to verify error handling.