Socket
Socket
Sign inDemoInstall

babel-plugin-jest-hoist

Package Overview
Dependencies
0
Maintainers
3
Versions
189
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 19.0.0 to 19.1.0-alpha.eed82034

27

build/index.js

@@ -115,5 +115,8 @@ /**

'reference any out-of-scope variables.\n' +
'Invalid variable access: ' + name + '\n' +
'Invalid variable access: ' +
name +
'\n' +
'Whitelisted objects: ' +
Object.keys(WHITELISTED_IDENTIFIERS).join(', ') + '.\n' +
Object.keys(WHITELISTED_IDENTIFIERS).join(', ') +
'.\n' +
'Note: This is a precaution to guard against uninitialized mock ' +

@@ -134,5 +137,4 @@ 'variables. If it is ensured that the mock is required lazily, ' +

FUNCTIONS.disableAutomock =
FUNCTIONS.enableAutomock =
args => args.length === 0;
FUNCTIONS.disableAutomock = FUNCTIONS.enableAutomock = args =>
args.length === 0;

@@ -143,3 +145,2 @@ module.exports = babel => {

callee.isMemberExpression() && isJest(callee.get('object'));
const shouldHoistExpression = expr => {

@@ -153,11 +154,7 @@ if (!expr.isCallExpression()) {

const property = callee.get('property');
return (
property.isIdentifier() &&
FUNCTIONS[property.node.name] && (
object.isIdentifier(JEST_GLOBAL) ||
callee.isMemberExpression() && shouldHoistExpression(object)) &&
FUNCTIONS[property.node.name](expr.get('arguments')));
return property.isIdentifier() &&
FUNCTIONS[property.node.name] && (
object.isIdentifier(JEST_GLOBAL) ||
callee.isMemberExpression() && shouldHoistExpression(object)) &&
FUNCTIONS[property.node.name](expr.get('arguments'));
};

@@ -164,0 +161,0 @@ return {

{
"name": "babel-plugin-jest-hoist",
"version": "19.0.0",
"version": "19.1.0-alpha.eed82034",
"repository": {

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc