effect-testing-mocking

Inject mock layers and a deterministic TestClock for effectful program tests.

5|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/mepuka/effect-ontology --skill effect-testing-mocking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-testing-mocking
Source: https://github.com/mepuka/effect-ontology/tree/main/.claude/skills/effect-testing-mocking
Command: npx skills add https://github.com/mepuka/effect-ontology --skill effect-testing-mocking

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Testing patterns with layers, mocks, and deterministic time. Use when preparing testable services and small smoke tests.

Core Features & Use Cases

  • Mock layers for service dependencies
  • Provide test implementations via Layer to isolate tests
  • Deterministic time via TestClock and controlled environments

Quick Start

Write a test that provides a mock Layer for a repository, run the program, and verify outcomes.

Frequently Asked Questions about effect-testing-mocking

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

FAQPage Schema
How do I write deterministic tests for services without external IO?

Deterministic testing isolates services by injecting mock layers and controlling time with a TestClock. Use Layer.succeed to provide test implementations of dependencies, eliminating external calls and making tests fast and reproducible.

What's the best way to mock service dependencies in unit tests?

Mock layers provide explicit test implementations per test using the Layer pattern. Each test receives its own mock dependencies, preventing cross-test interference and aligning with real service architecture patterns like Layer.ts.

How do I control time in tests to verify time-dependent behavior?

TestClock provides deterministic time control within test environments. Advance time programmatically to drive asynchronous behavior and verify outcomes without waiting for real delays, keeping tests focused and fast.

Can I use mocking and layers for smoke tests?

Yes. Smoke tests benefit from the same mock-layer and deterministic-clock patterns used in unit tests. This approach prevents IO leakage, maintains test speed, and verifies critical service paths without external dependencies.

What's required before setting up deterministic tests with mocks?

You need testable services structured with layers, mock implementations ready for each dependency, and familiarity with Layer, TestClock, and TestContext patterns. These patterns align with real API conventions already in use.