fetch-mocked

JSON →
library 0.0.33 ·javascript
verified Jun 7, 2026

A test framework integrated fetch mocking solution written as a native ESModule, compatible with Jest, Vitest, and other test frameworks that support a similar API (getMockImplementation, mockImplementation, mock.calls, mock.results, mock.lastCall). Version 0.0.33 is the latest stable release, with ongoing development. Unlike other fetch mocking libraries, fetch-mocked is a pure ESModule with no CommonJS dependencies, making it fully compatible with native ESModule projects. It provides an enriched mock function that integrates assertions and mock utilities from the test framework, along with polyfills for fetch, Request, Response, and Headers using node-fetch.