Skip to content
Mock http requests made using fetch
Branch: master
Clone or download
wheresrhys keeping arbitrary options on fetch (#431)
keeping arbitrary options on fetch
Latest commit 28744cd Jun 6, 2019


Mock http requests made using fetch

node version licence npm downloads CircleCI Code coverage Known Vulnerabilities

fetchMock.mock('', 200);
const res = await fetch('');

Table of Contents

I devote a lot of time to maintaining fetch-mock for free. I don't ask for payment, but am raising money for a refugee charity - please consider donating


fetch-mock requires the following to run:

  • Node.js 8+ for full feature operation
  • Node.js 0.12+ with limitations
  • npm (normally comes with Node.js)
  • Either of the following
    • node-fetch when testing in a nodejs
    • A browser that supports the fetch API when testing in a browser

Documentation and Usage

See the project website


fetch-mock is licensed under the MIT license. Copyright © 2019, Rhys Evans


npm version maintainability

You can’t perform that action at this time.