effect-ts-testing

Write Effect-based tests with @effect/vitest and type-safe assertions.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/morgs32/skills --skill effect-ts-testing
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: effect-ts-testing
Source: https://github.com/morgs32/skills/tree/main/skills/effect-ts-testing
Command: npx skills add https://github.com/morgs32/skills --skill effect-ts-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Testing Effect-based code can be complex due to asynchronous effects, layering of services, and ensuring type-safe expectations across runs. This skill provides guidelines and patterns to write, review, and maintain tests for Effect values, layers, and related utilities.

Core Features & Use Cases

  • Use @effect/vitest for effect-based tests to ensure consistent execution semantics.
  • Apply type-safe assertions with tsafe to validate compile-time type correctness.
  • Employ DateTime.now in tests instead of new Date to avoid flaky time-based behavior.
  • Decode unknown values with decodeUnknown from zerospin and map errors to ZerospinError in both generator-based and async contexts.

Quick Start

Install the recommended testing packages (such as @effect/vitest, tsafe, zerospin, and effect) and begin applying the patterns in your test suites.

Frequently Asked Questions about effect-ts-testing

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

FAQPage Schema
How do I write reliable tests for Effect-based code without flaky asynchronous behavior?▼

Testing Effect-based code reliably involves using @effect/vitest for consistent execution semantics and DateTime.now instead of new Date to prevent flaky time-based behavior in your test suites.

How do I ensure type-safe assertions when testing TypeScript Effect values?▼

Type-safe assertions for Effect values are enforced using tsafe to validate compile-time type correctness, ensuring your TypeScript expectations remain consistent across different test runs.

What is the best way to decode unknown values in Effect tests without causing runtime errors?▼

Decoding unknown values in Effect tests uses decodeUnknown from zerospin to map errors to ZerospinError, working seamlessly in both generator-based and async/await contexts.

Does this testing approach work with both async/await and generator-based Effect contexts?▼

Yes, the testing patterns apply to both generator-based and async/await contexts, documenting usage of decodeUnknown and testing helpers across TypeScript projects using the Effect library.

Why are my Effect tests failing due to time-based dependencies?▼

Time-based test failures occur when using new Date; employing DateTime.now in your Effect tests avoids flaky behavior by providing reliable and consistent time-based utilities.

What dependencies do I need to install to start testing Effect values?▼

To start testing Effect values, install recommended packages like @effect/vitest, tsafe, zerospin, and effect to apply robust testing patterns for layers, services, and asynchronous effects.