fetch-mock
Advanced tools
Comparing version 3.0.4 to 3.1.0
@@ -15,4 +15,3 @@ 'use strict'; | ||
browserify: { | ||
transform: [['babelify', { presets: ['es2015'] }]], | ||
debug: true | ||
debug: true | ||
}, | ||
@@ -19,0 +18,0 @@ browsers: ['Chrome'], |
{ | ||
"name": "fetch-mock", | ||
"version": "3.0.4", | ||
"version": "3.1.0", | ||
"description": "Mock http requests made using fetch (or isomorphic-fetch)", | ||
@@ -9,3 +9,4 @@ "main": "src/server.js", | ||
"test": "make test", | ||
"prepublish": "babel src --out-dir es5 --presets es2015" | ||
"browserify": "browserify -s fetchMock src/client.js > es5/client-browserified.js", | ||
"prepublish": "babel src --out-dir es5 --presets es2015 && npm run browserify" | ||
}, | ||
@@ -50,3 +51,15 @@ "repository": { | ||
"whatwg-fetch": "^0.10.1" | ||
}, | ||
"browserify": { | ||
"transform": [ | ||
[ | ||
"babelify", | ||
{ | ||
"presets": [ | ||
"es2015" | ||
] | ||
} | ||
] | ||
] | ||
} | ||
} |
@@ -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](#troubleshooting) [V3 changelog](https://github.com/wheresrhys/fetch-mock/pull/35) | ||
[Troubleshooting](#troubleshooting), [V3 changelog](https://github.com/wheresrhys/fetch-mock/pull/35) | ||
@@ -133,3 +133,2 @@ *To output useful messages for debugging `export DEBUG=fetch-mock`* | ||
``` | ||
## Troubleshooting | ||
@@ -139,3 +138,4 @@ | ||
- If your client-side code or tests do not use a loader that respects the browser field of package.json use `require('fetch-mock/es5/client')`. This can also be loaded directly in a script tag as `./node_modules/fetch-mock/es5/client.js` (Disclaimer: I haven't actually tried this, but it should work) | ||
- If your client-side code or tests do not use a loader that respects the browser field of package.json use `require('fetch-mock/es5/client')`. | ||
- If you need to use fetch-mock without commonjs, you can include the precompiled `node_modules/fetch-mock/es5/client-browserified.js` in a script tag. This loads fetch-mock into the `fetchMock` global variable. | ||
- For server side tests running in nodejs 0.12 or lower use `require('fetch-mock/es5/server')` | ||
@@ -157,3 +157,3 @@ | ||
.then(res => { | ||
expect(fetchMock.calls().length).to.equal(1); | ||
expect(fetchMock.calls().matched.length).to.equal(1); | ||
expect(res.status).to.equal(301); | ||
@@ -160,0 +160,0 @@ fetchMock.restore(); |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
76248
17
2039
2