speedskater / babel-plugin-rewire

A babel plugin adding the ability to rewire module dependencies. This enables to mock modules for testing purposes.
843 stars 90 forks source link

Incompatibility with babel-plugin-jest-hoist #212

Open kayalukenvolatile opened 6 years ago

kayalukenvolatile commented 6 years ago
/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)
Takaitra commented 6 years ago

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.

cwagner22 commented 5 years ago

Did anyone find a solution to this issue?

rsallar commented 4 years ago

Having the same issue.