Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with jest, Invalid variable access: _get__ #223

Open
cwagner22 opened this issue Mar 5, 2019 · 6 comments
Open

Not working with jest, Invalid variable access: _get__ #223

cwagner22 opened this issue Mar 5, 2019 · 6 comments

Comments

@cwagner22
Copy link

babel-plugin-rewire is not working with jest for me, because of babel-plugin-jest-hoist.

babel-plugin-jest-hoist: The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables.
    Invalid variable access: _get__

To Reproduce

Check out this repo.
Run npm run jest

I know there is already a similar issue open but I don't understand why not more people are having this issue since the app is downloaded 70k+ times per week.
Since babel-plugin-jest-hoist is included in babel-jest I believe it should affect many people...

@bhovhannes
Copy link

Seems to be similar to #183

@cwagner22
Copy link
Author

@bhovhannes Yes, unfortunately no solution worked for me, I had to patch babel-plugin-jest-hoist to whitelist _get__...

@VandalPaulius
Copy link

I think I have similar problem, but it say TypeError: _get__(...) is not a function.

@sergio-domingues
Copy link

Did anyone discover a solution for this issue?

@nGoline
Copy link

nGoline commented Jul 15, 2022

I'm having the same issue. Does anyone know how to overcome this?
@cwagner22 Can you share how you patched it?

@lancemarks
Copy link

I am having this issue. It is holding up an important PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants