Socket
Socket
Sign inDemoInstall

@4c/fetch-mock

Package Overview
Dependencies
10
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @4c/fetch-mock

Mock http requests made using fetch (or isomorphic-fetch)


Version published
Weekly downloads
54
decreased by-28%
Maintainers
4
Install size
3.00 MB
Created
Weekly downloads
 

Readme

Source

fetch-mock

Mock http requests made using fetch

node version licence npm downloads CircleCI Code coverage Known Vulnerabilities

fetchMock.mock('http://example.com', 200);
const res = await fetch('http://example.com');
assert(res.ok);
fetchMock.restore();

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


Requirements

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

License

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

Housekeeping

npm version maintainability

Keywords

FAQs

Last updated on 27 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc