effect-ts-testing

Configure Effect-TS test layers with SQLite-backed mocks for deterministic service testing.

Updated Jul 7, 2026
One-click install
npx skills add https://github.com/TitoPrausee/nexus-toti --skill effect-ts-testing-titoprausee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-ts-testing
Source: https://github.com/TitoPrausee/nexus-toti/tree/main/data/skills/software-development/effect-ts-testing
Command: npx skills add https://github.com/TitoPrausee/nexus-toti --skill effect-ts-testing-titoprausee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you test Effect-TS services without runtime failures from missing dependencies, unstable external services, or incorrect layer composition.

Core Features & Use Cases

  • In-memory database setup: Creates isolated SQLite-backed test layers so each test runs against clean data.
  • Service mocking patterns: Shows how to build Layer.sync and Layer.succeed mocks that match real service signatures and return Effect values correctly.
  • Layer composition guidance: Explains how to wire shared dependencies, transitive dependencies, and bottom-up layer trees for complex service graphs.
  • E2E test strategy: Supports full-pipeline tests with a mocked LLM boundary while preserving deterministic behavior and error handling.
  • Use case: Validate an Effect-TS orchestrator, agent executor, or skill loader with realistic dependencies while avoiding Service not found errors and flaky state leakage.

Quick Start

Use the effect-ts-testing skill to build a shared in-memory SQLite test layer with matching mock services for your Effect-TS project.

Frequently Asked Questions about effect-ts-testing

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

FAQPage Schema
How do I fix missing layer errors when testing Effect-TS services?

Missing layer errors in Effect-TS testing occur when required dependencies are not provided. You can resolve them by building Layer.sync or Layer.succeed mocks that match real service signatures and wiring shared dependencies through correct bottom-up layer composition.

What is the best way to mock external dependencies in Effect-TS integration tests?

Mocking external dependencies in Effect-TS integration tests is best done by creating Layer.sync and Layer.succeed mocks that match real service signatures. This ensures tests remain deterministic and runtime-safe without relying on unstable external services like live databases or LLM providers.

Why does Effect.runPromise fail in my Effect-TS unit tests?

Effect.runPromise fails in unit tests when the required layer tree is incomplete or mock signatures are broken. Correct Effect.runPromise usage requires providing a fully composed layer graph with matching mock services to execute the effect safely without runtime errors.

Can I use an in-memory SQLite database for isolated Effect-TS service tests?

Yes, you can use an in-memory SQLite database for isolated Effect-TS service tests. Creating isolated SQLite-backed test layers ensures each test runs against clean data, preventing state leakage and keeping database-dependent service tests deterministic.

How do you build deterministic E2E tests for an Effect-TS orchestrator?

Building deterministic E2E tests for an Effect-TS orchestrator involves mocking the LLM boundary while preserving real error handling behavior. This approach validates the full pipeline against realistic dependencies without introducing flaky external service calls.

When do I need to use Layer.succeed instead of Layer.sync in Effect-TS tests?

You need to use Layer.succeed instead of Layer.sync in Effect-TS tests when a mock service can return a static value directly. Layer.sync is used when the mock requires construction logic, ensuring the mock matches the real service signature and returns Effect values correctly.