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

fix(jest-runtime): bind jest.isolateModulesAsync to this #14083

Merged
merged 2 commits into from Apr 19, 2023

Conversation

tjenkinson
Copy link
Contributor

Summary

jest.isolateModulesAsync currently doesn't work as this is not bound to the correct object. this._isolatedModuleRegistry on the actual instance doesn't get set so isolateModulesAsync is essentially a no-op.

Test plan

Added a new test that fails without the fix.

@tjenkinson tjenkinson marked this pull request as ready for review April 18, 2023 16:27
runtime.__mockRootPath,
'ModuleWithState',
);
expect(exports.getState()).toBe(1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would fail before

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great catch!

@SimenB SimenB merged commit 77c2c6e into jestjs:main Apr 19, 2023
79 checks passed
@pwasem
Copy link

pwasem commented Apr 27, 2023

@tjenkinson I am currently facing this issue that jest.isolateModulesAsync is not working as expected using jest@29.5.0.

any idea in which release this fix will be included?

DmitryMakhnev pushed a commit to DmitryMakhnev/jest that referenced this pull request May 5, 2023
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2023
@SimenB
Copy link
Member

SimenB commented Jul 4, 2023

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

Successfully merging this pull request may close these issues.

None yet

4 participants