What problem does it solve?
Testing Effect-based code can be slow, flaky, and hard to reason about when time, services, and error channels are involved.
Core Features & Use Cases
- Deterministic testing with @effect/vitest: choose the right runner (
it.effect vs it.live) so time and randomness behave correctly.
- Correct dependency injection with Layers: provide real services or mocked layers with clear scope and composition.
- Time-dependent testing with TestClock: advance time instantly to avoid sleeps and hanging tests.
- Robust error & failure assertions: validate failures using
Effect.flip, Effect.exit, and error-cause inspection.
- Property-based testing: use
it.prop and it.effect.prop to cover behaviors across many generated cases.
- Protocol-level testing guidance: prefer HTTP mock server tests for HTTP/SSE behavior over service fakes when transport correctness matters.
Quick Start
Use the effect-testing skill to help you write comprehensive tests for your Effect-based module using @effect/vitest and vitest, including time simulation with TestClock and Layer-provided dependencies.