Socket
Socket
Sign inDemoInstall

jest-mock

Package Overview
Dependencies
Maintainers
5
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-mock - npm Package Compare versions

Comparing version 21.3.0-alpha.eff7a1cf to 21.3.0-beta.2

22

build/index.js

@@ -37,2 +37,3 @@ 'use strict';

const MOCK_CONSTRUCTOR_NAME = 'mockConstructor'; /**

@@ -273,2 +274,3 @@ * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.

mockImpl: undefined,
mockName: 'jest.fn()',
specificMockImpls: [],

@@ -331,5 +333,6 @@ specificReturnValues: [] };

// Run the mock constructor implementation
return (
mockConfig.mockImpl && mockConfig.mockImpl.apply(this, arguments));
const mockImpl = mockConfig.specificMockImpls.length ?
mockConfig.specificMockImpls.shift() :
mockConfig.mockImpl;
return mockImpl && mockImpl.apply(this, arguments);
}

@@ -439,2 +442,15 @@

f.mockName = name => {
if (name) {
const mockConfig = this._ensureMockConfig(f);
mockConfig.mockName = name;
}
return f;
};
f.getMockName = () => {
const mockConfig = this._ensureMockConfig(f);
return mockConfig.mockName || 'jest.fn()';
};
if (metadata.mockImpl) {

@@ -441,0 +457,0 @@ f.mockImplementation(metadata.mockImpl);

2

package.json
{
"name": "jest-mock",
"version": "21.3.0-alpha.eff7a1cf",
"version": "21.3.0-beta.2",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

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