Socket
Socket
Sign inDemoInstall

fetch-mock

Package Overview
Dependencies
Maintainers
1
Versions
226
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 3.0.4 to 3.1.0

es5/client-browserified.js

3

karma.conf.js

@@ -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();

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