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

Hoist static variables before hoisted mocks #653

Conversation

nicolo-ribaudo
Copy link

@nicolo-ribaudo nicolo-ribaudo commented Nov 1, 2020

I took a different approach here: during the normal traversal I mark the variables that should be hoisted, and then hoist them in post using the same logic used to hoist jest.mock calls.

Ref: jestjs#10723

@SimenB
Copy link
Owner

SimenB commented Nov 1, 2020

🙀 I missed this PR! Thanks @nicolo-ribaudo, this is way better

@SimenB SimenB merged commit f294765 into SimenB:react-automatic-runtime-mock Nov 1, 2020
@nicolo-ribaudo nicolo-ribaudo deleted the react-automatic-runtime-mock branch November 1, 2020 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants