testing

Installation
SKILL.md

Testing in Effect

Overview

Effect testing uses @effect/vitest as the standard test runner integration. This package provides Effect-aware test functions that handle Effect execution, scoped resources, layer composition, and TestClock injection automatically.

The two pillars of Effect testing that enable 100% test coverage:

  1. Service-Oriented Architecture — Every external/effectful dependency (API calls, databases, file systems, third-party services, clocks, random number generators) MUST be wrapped in an Effect Service using Context.Tag. Tests provide test implementations via Layers, giving you complete control over all I/O and side effects.

  2. Schema-Driven Property Testing — Since every data type has a Schema, every data type can generate test data via Arbitrary. This makes property-based testing the primary approach for verifying domain logic across thousands of automatically generated inputs.

Together, these two pillars mean: services eliminate external dependencies from tests, and Arbitrary eliminates hand-crafted test data. The result is fast, deterministic, comprehensive tests with 100% coverage.

Core testing tools:

  • @effect/vitest - Effect-native test runner (it.effect, it.scoped, it.live, it.layer, it.prop)
  • Effect Services + Test Layers - Replace ALL external dependencies with test doubles via Context.Tag and it.layer
  • Schema.Arbitrary - Generate test data from any Schema (primary approach — never hand-craft test data)
Related skills

More from andrueandersoncs/claude-skill-effect-ts

Installs
13
GitHub Stars
8
First Seen
Jan 24, 2026