effect-atom-testing

Standardize vitest testing for effect-atom atoms with mocks and timer control.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/lucas-barake/dotai --skill effect-atom-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-atom-testing
Source: https://github.com/lucas-barake/dotai/tree/main/canonical/skills/effect-atom-testing
Command: npx skills add https://github.com/lucas-barake/dotai --skill effect-atom-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Testing patterns for effect-atom/atom and atom-react, enabling robust, deterministic tests and consistent behavior across test suites.

Core Features & Use Cases

  • Standardized test setups for per-test Registry and fresh atom registries.
  • Built-in support for vitest fake timers, atom lifecycles, and mock layers.
  • Examples covering Atom, Atom.fn, and React components that consume atoms with mocks and streams.

Quick Start

Create a per-test Registry, mount the atom, and control timers to run deterministic tests.

Frequently Asked Questions about effect-atom-testing

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

FAQPage Schema
How do I test React components that consume atoms using vitest?

To test React components that consume atoms using vitest, you need standardized test setups that mount the atom and control lifecycles. This approach provides built-in support for mock layers and streams to ensure deterministic component behavior across test suites.

What is the best way to mock services and control timers in effect-atom tests?

Mocking services and controlling timers in effect-atom tests requires combining Layer-based mocks with vitest fake timers. This setup provides clear testing APIs and per-test lifecycle patterns to manage streams and service dependencies deterministically.

Does vitest support per-test Registry setups for effect-atom patterns?

Yes, vitest supports per-test Registry setups for effect-atom patterns by creating fresh atom registries for each test. This isolation strategy ensures consistent behavior and prevents state leakage between tests across the suite.

How do I write deterministic tests for Atom.fn patterns with streams?

Writing deterministic tests for Atom.fn patterns with streams involves using standardized testing patterns with built-in timer control. This ensures that stream-based data flows and atom lifecycles execute predictably within the test environment.

Why are my effect-atom tests failing due to state leakage between test suites?

Effect-atom tests fail due to state leakage when registries are not properly isolated per test. Implementing fresh per-test Registry setups and applying per-test lifecycle patterns prevents shared state and ensures robust, deterministic test execution.