effect-v4-testing

Configure Effect v4 test suites with @effect/vitest and virtual clock control.

2|Updated Jul 2, 2026
One-click install
npx skills add https://github.com/spencerbeggs/effected --skill effect-v4-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-v4-testing
Source: https://github.com/spencerbeggs/effected/tree/main/plugin/skills/effect-v4-testing
Command: npx skills add https://github.com/spencerbeggs/effected --skill effect-v4-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill addresses the complexities of testing Effect v4 code, specifically preventing common pitfalls like false greens, virtual clock hangs, and leaked test state that often plague asynchronous Effect-based test suites.

Core Features & Use Cases

  • Standardized Test Runner: Provides the canonical patterns for using it.effect and Effect.gen to ensure proper environment and scope management.
  • Fault Injection & Mocking: Offers robust recipes for decorating real services and injecting faults to prove system resilience.
  • Advanced Assertions: Guides the use of Effect.flip, Effect.exit, and structural source-text checks to ensure tests are discriminating and not vacuous.

Quick Start

Use the effect-v4-testing skill to audit your current test suite for false greens and implement the recommended layer-based mocking patterns.

Frequently Asked Questions about effect-v4-testing

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

FAQPage Schema
How do I test Effect v4 applications with Vitest without getting false greens?

To prevent false greens in Effect v4 testing, use the @effect/vitest framework with it.effect and Effect.gen patterns to ensure proper environment and scope management, validating suite integrity through structural source analysis.

How do I control the virtual clock when testing asynchronous Effect code?

Control the virtual clock in asynchronous Effect testing by configuring virtual test environments through the @effect/vitest framework. This ensures reliable execution of asynchronous effects and prevents virtual clock hangs common in test suites.

What is the best way to mock services and inject faults in Effect v4 tests?

The best way to mock services in Effect v4 is by decorating real services and injecting faults using stateful layer management. This robust recipe approach proves system resilience by testing how your application handles service failures.

How do I assert errors in Effect v4 test suites without writing vacuous tests?

Assert errors in Effect v4 test suites using Effect.flip and Effect.exit to check the error channel. Combine these with structural source-text checks to ensure your tests are discriminating and not vacuous, validating actual failure conditions.

Does mutation testing work with @effect/vitest to validate test suite integrity?

Yes, mutation testing works with @effect/vitest to validate test suite integrity. The framework supports implementing mutation testing strategies that expose false greens and ensure your Effect v4 test suite accurately catches code defects.

Why does my Effect v4 test suite leak state between test runs?

Effect v4 test suites leak state between runs due to improper management of stateful layers. Configuring virtual test environments with the @effect/vitest framework ensures proper scope management and isolates test state effectively.