Jest Fetch Mock

JSON →
library 3.0.4 ·javascript
verified Jun 7, 2026

Mock for fetch calls in Jest tests. v3.0.4 enables mocking global fetch (including cross-fetch polyfill) with Jest's built-in mock functions. It provides a simple API with mockResponse, mockResponses, mockReject, and mockOnce methods. Supports TypeScript types, conditional mocking by URL, and resetting state between tests. Lightweight alternative to MSW or nock for unit tests.