Socket
Socket
Sign inDemoInstall

babel-plugin-jest-hoist

Package Overview
Dependencies
0
Maintainers
4
Versions
189
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 13.2.2 to 13.2.3-alpha.ffc7404b

18

build/index.js

@@ -17,6 +17,8 @@ /**

// We allow `jest`, `require`, all default Node.js globals and all ES2015
// built-ins to be used inside of a `jest.mock` factory.
// We allow `jest`, `expect`, `require`, all default Node.js globals and all
// ES2015 built-ins to be used inside of a `jest.mock` factory.
// We also allow variables prefixed with `mock` as an escape-hatch.
const WHITELISTED_IDENTIFIERS = {
jest: true,
expect: true,
require: true,

@@ -107,8 +109,12 @@ Infinity: true,

invariant(
scope.hasGlobal(name) && WHITELISTED_IDENTIFIERS[name],
'The second argument of `jest.mock()` is not allowed to ' +
'reference any outside variables.\n' +
scope.hasGlobal(name) && WHITELISTED_IDENTIFIERS[name] ||
/^mock/.test(name),
'The module factory of `jest.mock()` is not allowed to ' +
'reference any out-of-scope variables.\n' +
'Invalid variable access: ' + name + '\n' +
'Whitelisted objects: ' +
Object.keys(WHITELISTED_IDENTIFIERS).join(', ') + '.');}}
Object.keys(WHITELISTED_IDENTIFIERS).join(', ') + '.\n' +
'Note: This is a precaution to guard against uninitialized mock ' +
'variables. If it is ensured that the mock is required lazily, ' +
'variable names prefixed with `mock` are permitted.');}}

@@ -115,0 +121,0 @@

{
"name": "babel-plugin-jest-hoist",
"version": "13.2.2",
"version": "13.2.3-alpha.ffc7404b",
"repository": {

@@ -15,3 +15,3 @@ "type": "git",

"jest": {
"rootDir": "./build",
"rootDir": "./src",
"scriptPreprocessor": "../../babel-jest",

@@ -18,0 +18,0 @@ "testEnvironment": "node"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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