mcous

mcous/vitest-when

Stub behaviors of Vitest mock functions based on how they are called

TypeScript
51
8
MIT License

**Project summary** `vitest-when` adds a lightweight, declarative API for configuring stub behaviors on Vitest mock functions, letting you specify exact argument matches (via `calledWith`) and attach precise return, promise‑resolve, throw, or side‑effect handlers (`thenReturn`, `thenResolve`, `thenThrow`, `thenDo`, etc.) without scattering expectations across test phases. It’s aimed at developers who want clearer, harder‑to‑misconfigure mock setups—especially in TypeScript projects—where stub configuration lives entirely in the “arrange” stage and is fully type‑checked.

Total donated
Undistributed
Share with your subscribers:

Recipients

How the donated funds are distributed

Support the dependencies

Support the repos that depend on this repository

Top contributors

mcous's profile
mcous
49 contributions
sirlancelot's profile
sirlancelot
2 contributions
tommie-lie's profile
tommie-lie
1 contributions

Recent events

Kivach works on the Obyte network, and therefore you can track all donations.

No events yet