effect-patterns-testing

Test Effect-TS applications with deterministic patterns for services and time.

1|1|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/tomsiwik/dojocho --skill effect-patterns-testing-tomsiwik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-patterns-testing
Source: https://github.com/tomsiwik/dojocho/tree/main/dojos/effect-ts/skills/effect-patterns-testing
Command: npx skills add https://github.com/tomsiwik/dojocho --skill effect-patterns-testing-tomsiwik

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write robust and maintainable tests for Effect-TS applications by providing proven patterns and best practices.

Core Features & Use Cases

  • Testing Effect Programs: Learn how to run and assert on Effect results directly in tests.
  • Service Mocking: Understand how to provide test implementations for Effect services to isolate units.
  • Time-Dependent Logic: Master testing functions that rely on the current time using TestClock.
  • Use Case: When refactoring a complex Effect-TS module, use this Skill to ensure your tests accurately cover all scenarios, including asynchronous operations and service dependencies.

Quick Start

Write tests for your Effect-TS code by running effects with Effect.runPromise and asserting on the results.

Frequently Asked Questions about effect-patterns-testing

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

FAQPage Schema
How do I test asynchronous Effect-TS code deterministically?

Testing asynchronous Effect-TS code deterministically involves running effects with `Effect.runPromise` and asserting results directly. You control time-dependent logic using `TestClock` to ensure consistent outcomes without real delays.

How do I mock service dependencies in Effect-TS tests?

Mocking service dependencies in Effect-TS tests uses `Effect.provideService` to inject test implementations. This isolates units by replacing real service dependencies with controlled test versions during execution.

Can I use vitest with Effect-TS for testing streams?

Yes, you can use vitest with Effect-TS for testing streams by utilizing `Stream.runCollect`. This pattern allows you to collect stream emissions into an array, enabling standard assertions on the asynchronous stream output.

What is the best way to test time-dependent logic in Effect-TS?

The best way to test time-dependent logic in Effect-TS is using the `TestClock`. It allows you to manually adjust the `Clock` service, making time-based asynchronous operations deterministic and eliminating real-time waiting during tests.

Do I need vitest to run Effect-TS testing patterns?

While vitest is a primary keyword, the core patterns focus on Effect-TS execution and mocking. You run effects using `Effect.runPromise`, which works within vitest or similar test runners supporting promise assertions.