vitest
Vitest
Repository configuration, projects, setup, imports/globals, environments, aliases, test placement, and cleanup own the test contract. Inspect them and nearby tests before adding generic patterns. Do not add globals, jsdom, coverage, new setup, or browser mode by default.
Workflow
Define the behavior or regression. Test its observable public result. Mock system boundaries rather than the behavior
under test. Follow local fixture and cleanup ownership. In Effect repositories, use established @effect/vitest
conventions such as it.effect, Layers, and TestClock rather than generic replacements. For a bug fix, reproduce the
failure before relying on a passing result when practical.
Read patterns for component, async, fixture, snapshot, tag, or browser questions. Read mocking for module, timer, spy, or global boundaries. Read configuration for projects, migration, coverage, or reporter selection. Read troubleshooting for hangs, discovery, resolution, or flaky state.