Vitest Fetch Mock
JSON →Vitest Fetch Mock (v0.4.5) is a fetch mocking library for Vitest, forked from jest-fetch-mock. It mocks the global fetch API using Vitest's vi.fn() under the hood, providing a simple API to mock responses, inspect calls, and reset state. Works with Vitest >=2.0.0 and Node >=18. Unlike nock or msw, it directly replaces global.fetch without interceptors or service workers. Ships TypeScript types.
Resources
packagevitest-fetch-mock ↗
API endpoints
full doc /v1/registry/vitest-fetch-mock