babel-plugin-rewire icon indicating copy to clipboard operation
babel-plugin-rewire copied to clipboard

Incompatibility with babel-plugin-jest-hoist

Open kayalukenvolatile opened this issue 6 years ago • 3 comments

/path/to/jest/setup.js: babel-plugin-jest-hoist: The module factory of `jest.mock()` is not allowed 
to reference any out-of-scope variables.
Invalid variable access: _get__
Whitelisted objects: Array,..., setTimeout.
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.
  
  at invariant (node_modules/babel-plugin-jest-hoist/build/index.js:13:11)

kayalukenvolatile avatar Apr 26 '18 12:04 kayalukenvolatile

babel-plugin-jest-hoists is included with the react native babel preset. Due to this bug I am unable to use babel-plugin-rewire with react native.

Takaitra avatar May 16 '18 00:05 Takaitra

Did anyone find a solution to this issue?

cwagner22 avatar Mar 04 '19 15:03 cwagner22

Having the same issue.

rsallar avatar Sep 15 '19 20:09 rsallar