fetch-mock

JSON →
library 7.3.1-fork-0.1.0 ·javascript
verified Jun 7, 2026

A comprehensive mocking library for the Fetch API, allowing you to easily mock HTTP requests in unit tests. Version 7.3.1-fork-0.1.0 (fork maintained by One.com) supports Node.js 8+ and browsers. It provides a fluent API for matching URLs, methods, headers, and bodies, with both sandbox and global modes. Compared to alternatives like nock or msw, fetch-mock is lightweight and focused solely on fetch mocking without needing a service worker.