Is there any way to use babel-plugin-rewire with jest? Because of babel-plugin-jest-hoist I get this error simply by adding "rewire" to the plugins in babel.config.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__
Check out this repo.
Run npm run jest
Is there any specific reasons for needing to use rewire? Jest has a pretty good suite of tools for mocking things out of the box
I need to mock an internal function of my module which I can't do with Jest. Like here: https://medium.com/@qjli/how-to-mock-specific-module-function-in-jest-715e39a391f4
I have the same issue. Is there anything new?
Most helpful comment
I need to mock an internal function of my module which I can't do with Jest. Like here: https://medium.com/@qjli/how-to-mock-specific-module-function-in-jest-715e39a391f4