Skip to content

Conversation

andrew-the-drawer
Copy link
Contributor

@andrew-the-drawer andrew-the-drawer commented Feb 4, 2025

Summary

Problem:

When stubbing the existing node_module package by another node_module package via moduleNameMapper settings, the resolve conditions are not respected. For example, in this PR, it does not resolve to browser export of the example-test-module when the test environment is jsdom.

Solution:

Pass through the options.conditions field in the resolveStubModuleName.

Test plan

Demonstrated in the unit test

Copy link

linux-foundation-easycla bot commented Feb 4, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

netlify bot commented Feb 4, 2025

Deploy Preview for jestjs ready!

Name Link
🔨 Latest commit 1fa2298
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/67af75c37fa81d0009cb9029
😎 Deploy Preview https://deploy-preview-15489--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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.

thanks, this seems like a good change 👍

In addition to the inline comments, mind adding a changelog entry?

@andrew-the-drawer andrew-the-drawer force-pushed the fix/load-stub-module-conditions branch from c29e3b7 to 1accf78 Compare February 11, 2025 03:32
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.

thanks!

@SimenB SimenB merged commit 4a4c031 into jestjs:main Feb 14, 2025
4 checks passed
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 Mar 17, 2025
@andrew-the-drawer andrew-the-drawer deleted the fix/load-stub-module-conditions branch May 29, 2025 16:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants