Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fetch-mock

Package Overview
Dependencies
Maintainers
1
Versions
231
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-mock - npm Package Compare versions

Comparing version 4.5.0 to 4.5.1

2

package.json
{
"name": "fetch-mock",
"version": "4.5.0",
"version": "4.5.1",
"description": "Mock http requests made using fetch (or isomorphic-fetch)",

@@ -5,0 +5,0 @@ "main": "src/server.js",

@@ -8,3 +8,3 @@ # fetch-mock [![Build Status](https://travis-ci.org/wheresrhys/fetch-mock.svg?branch=master)](https://travis-ci.org/wheresrhys/fetch-mock)

[Troubleshooting and alternative installation](#troubleshooting), [V4 changelog](#v4-changelog)
[Troubleshooting and alternative installation](#troubleshooting-and-alternative-installation), [V4 changelog](#v4-changelog)

@@ -144,2 +144,5 @@ ## Basic usage

### Matching `Request` objects in node fails
In node, if using npm at a version less than 2 the `Request` constructor used by `fetch-mock` won't necessarily be the same as the one used by `isomorphic-fetch`. To fix this upgrade to npm@3.
### Polyfilling fetch

@@ -146,0 +149,0 @@ * In nodejs `require('isomorphic-fetch')` before any of your tests.

@@ -18,2 +18,16 @@ 'use strict';

describe('support for Buffers', function () {
it('can respond with a buffer', function () {
fetchMock.mock(/a/, {
sendAsJson: false,
body: new Buffer('buffer')
})
return fetch('http://a.com')
.then(res => res.text())
.then(txt => {
expect(txt).to.equal('buffer');
});
});
});
describe('new non-global use', function () {

@@ -20,0 +34,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc