View on GitHub


Mock http requests made using fetch

fetch-mock allows mocking http requests made using fetch, or any one of the many libraries imitating its api such as isomorphic-fetch, node-fetch and fetch-ponyfill.

The library will run in most JavaScript environments, including nodejs, web workers and service workers, and any browser that either supports fetch natively or that can have a fetch polyfill/ponyfill installed.

As well as shorthand methods for the simplest use cases, it offers a flexible API for customising all aspects of mocking behaviour.