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 8.2.0-beta.1 to 8.2.0-beta.2

12

cjs/server.js
// avoid circular dependency when using jest.mock()
const fetch = global.jest
? global.jest.requireActual('node-fetch')
: require('node-fetch');
let fetch;
try {
// note that jest is not a global, but is injected somehow into
// the environment. So we can't be safe and check for global.jest
// Hence the try/catch
fetch = jest.requireActual('node-fetch'); //eslint-disable-line no-undef
} catch (e) {
fetch = require('node-fetch');
}
const Request = fetch.Request;

@@ -6,0 +12,0 @@ const Response = fetch.Response;

@@ -14,3 +14,11 @@ 'use strict';

// avoid circular dependency when using jest.mock()
var fetch = global.jest ? global.jest.requireActual('node-fetch') : require('node-fetch');
var fetch = void 0;
try {
// note that jest is not a global, but is injected somehow into
// the environment. So we can't be safe and check for global.jest
// Hence the try/catch
fetch = jest.requireActual('node-fetch'); //eslint-disable-line no-undef
} catch (e) {
fetch = require('node-fetch');
}
var Request = fetch.Request;

@@ -17,0 +25,0 @@ var Response = fetch.Response;

{
"name": "fetch-mock",
"type": "module",
"version": "8.2.0-beta.1",
"version": "8.2.0-beta.2",
"description": "Mock http requests made using fetch (or isomorphic-fetch)",

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

Sorry, the diff of this file is not supported yet

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