Skip to content

Adopt @effect/vitest (it.effect / layer) for tests; take effect-run-in-body and strict-effect-provide to error #600

Open

Description

@thomasfosterau

Owner decision (family-wide, 2026-11-12): for the Effect rules that fire in tests, adopt @effect/vitest's it.effect and layer rather than scoping the rules off for tests.

Current state (trunk)

  • effect/effect-run-in-body is at warn, with about 127 sites, nearly all in *.test.ts: Effect.runPromise / runSync inside it(...) bodies.
  • effecttsgo/strict-effect-provide is off for **/*.test.ts and examples/** (vite.config.ts).

Plan

  1. Add @effect/vitest to the catalog. The latest, 4.1.4, peers effect ^4.1.4 and vitest >=5 <6. Pinned effect is 4.1.2, so bump effect to 4.1.4 first, or in the same PR. Check that vite-plus/test's bundled vitest 5.0.5 satisfies the vitest peer, and that the "tests import from vite-plus/test, never vitest" convention (AGENTS.md) holds. @effect/vitest itself imports vitest, so AGENTS.md's rule may need a one-line exception for @effect/vitest.
  2. Rewrite the Effect-running tests as it.effect(...), and provide their layers with layer(...) / it.layer(...) instead of an inline Effect.provide. Where it is idiomatic, use TestClock (relevant to the use-clock-service PR).
  3. Flip effect-run-in-body to error, and delete the strict-effect-provide test override.
  4. Split this per AGENTS.md / the owner's lint rule: one PR for the dependency and its first file, then the rest grouped by module.

Tracked under #533 / #536.

Activity

  1. thomasfosterau commented on Nov 12, 2026

    @thomasfosterau
    OwnerAuthor

    Correction to the plan (orchestrator, 2026-11-12): @effect/vitest 4.1.2 exists and peers effect ^4.1.2 and vitest >=5 <6. Pin it at 4.1.2 to match the pinned effect, so no effect bump is needed. effect-bib, prosekit-utilities and effect-biz already run it under vp test, so the "doesn't load under the Vite+ alias" concern is stale.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions