cli-effect-testing

Compose Effect layers to test Bun CLI projects with bun:test.

1|Updated Apr 14, 2025
One-click install
npx skills add https://github.com/meteoricprovider/cursor-installer --skill cli-effect-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-effect-testing
Source: https://github.com/meteoricprovider/cursor-installer/tree/main/.claude/skills/cli-effect-testing
Command: npx skills add https://github.com/meteoricprovider/cursor-installer --skill cli-effect-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers write and review tests for Bun CLI projects that use Effect for dependency injection, preventing brittle mocks and enabling test reliability through layered DI.

Core Features & Use Cases

  • Enables testing of Bun CLI components by composing Effect layers instead of mocking modules.
  • Guides use of shared test helpers (createTestCliUI, createTestFileSystem, createTestHttpClient) to simulate UI, FS, and HTTP interactions.
  • Supports reviewing and maintaining tests for projects using bun:test as the runner, with clear patterns for test structure and DI.

Quick Start

Run bun test to execute the test suite for the Bun CLI project using Effect layers.

Frequently Asked Questions about cli-effect-testing

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

FAQPage Schema
How do I test a Bun CLI app using Effect layers instead of mocks?

Testing Bun CLI apps with Effect layers requires composing dependency injection layers instead of brittle mocks. You wire shared test helpers directly into the test scene to provide reliable UI, file system, and HTTP interactions without using mock.module patterns.

Why do my Bun CLI tests break when using mock.module for dependency injection?

Bun CLI tests break with mock.module because it creates brittle mocks that fail under refactoring. Using Effect layers for dependency injection eliminates this fragility by composing real test helpers in-scene rather than patching modules.

What are shared test helpers for Effect CLI testing in Bun?

Shared test helpers for Effect CLI testing in Bun are utilities like createTestCliUI, createTestFileSystem, and createTestHttpClient. They simulate user interface, file system, and HTTP interactions to provide controlled test environments through Effect layer composition.

Can I use bun:test with Effect for dependency injection in CLI projects?

You can use bun:test with Effect for dependency injection in CLI projects. This combination uses bun:test as the runner while wiring dependencies through Effect layers instead of relying on module mocks, ensuring reliable and maintainable test architectures.

What is the best way to structure Effect tests for a Bun CLI project?

The best way to structure Effect tests for a Bun CLI project is to use shared test helpers and Layer composition. This architecture replaces mock.module patterns with in-scene dependency injection, ensuring tests remain reliable and maintainable across refactoring.