Socket
Socket
Sign inDemoInstall

fetch-mock

Package Overview
Dependencies
Maintainers
3
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 9.1.2 to 9.2.0

11

cjs/lib/set-up-and-tear-down.js

@@ -83,3 +83,12 @@ const { debug, setDebugPhase } = require('./debug');

};
const defineGreedyShorthand = (methodName, underlyingMethod) => {
FetchMock[methodName] = function(response, options) {
return this[underlyingMethod]({}, response, options);
};
};
defineShorthand('once', 'mock', { repeat: 1 });
defineGreedyShorthand('any', 'mock');
defineGreedyShorthand('anyOnce', 'once');

@@ -89,2 +98,4 @@ ['get', 'post', 'put', 'delete', 'head', 'patch'].forEach(method => {

defineShorthand(`${method}Once`, 'once', { method });
defineGreedyShorthand(`${method}Any`, method);
defineGreedyShorthand(`${method}AnyOnce`, `${method}Once`);
});

@@ -91,0 +102,0 @@

@@ -95,3 +95,12 @@ 'use strict';

};
var defineGreedyShorthand = function defineGreedyShorthand(methodName, underlyingMethod) {
FetchMock[methodName] = function (response, options) {
return this[underlyingMethod]({}, response, options);
};
};
defineShorthand('once', 'mock', { repeat: 1 });
defineGreedyShorthand('any', 'mock');
defineGreedyShorthand('anyOnce', 'once');

@@ -101,2 +110,4 @@ ['get', 'post', 'put', 'delete', 'head', 'patch'].forEach(function (method) {

defineShorthand(method + 'Once', 'once', { method: method });
defineGreedyShorthand(method + 'Any', method);
defineGreedyShorthand(method + 'AnyOnce', method + 'Once');
});

@@ -103,0 +114,0 @@

2

package.json
{
"name": "fetch-mock",
"type": "module",
"version": "9.1.2",
"version": "9.2.0",
"description": "Mock http requests made using fetch (or isomorphic-fetch)",

@@ -6,0 +6,0 @@ "main": "./cjs/server.js",

@@ -8,3 +8,3 @@ # fetch-mock

- helpers for all common http methods and for responding a limited number of times
- declarative matching for most aspects of a http request
- declarative matching for most aspects of a http request
- delayed responses

@@ -14,3 +14,3 @@ - spying on real network requests

*New* If using jest, try the new [fetch-mock-jest](https://www.npmjs.com/package/fetch-mock-jest) wrapper.
_New_ If using jest, try the new [fetch-mock-jest](https://www.npmjs.com/package/fetch-mock-jest) wrapper.

@@ -17,0 +17,0 @@ ![node version](https://img.shields.io/node/v/fetch-mock.svg?style=flat-square)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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