1.0.3 • Published 7 years ago

resin-fetch-mock v1.0.3

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
7 years ago

resin-fetch-mock

Common util to mock fetch requests in resin tests

npm version dependencies

Installation

Install resin-fetch-mock by running:

$ npm install --save resin-fetch-mock

Documentation

The module exposes two methods:

const { fetchMock, mockedFetch } = require("resin-fetch-mock")

The fetchMock is a sandboxed instance of fetch-mock preconfigured with the Bluebird Promise implementation.

Use it according to the fetch-mock documentation.

The mockedFetch function can be injected into your code as a drop-in replacement of the original fetch.

Note: in the browser environment requiring this module will set the Headers, Request, and Response constructors globally. These constructors are taken from the fetch-ponyfill module.

Support

If you're having any problem, please raise an issue on GitHub and the Resin.io team will be happy to help.

Contribute

License

The project is licensed under the Apache 2.0 license.

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago