fetch-mock
Advanced tools
Comparing version 4.5.0 to 4.5.1
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84849
2263
173
68