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: unable to resolve path to mapped file with custom platform #7312

Merged
merged 5 commits into from
Nov 1, 2018

Conversation

thymikee
Copy link
Collaborator

@thymikee thymikee commented Nov 1, 2018

Summary

Fixes a bug where Jest was unable to resolve a path to a file mapped with moduleNameMapper and having custom platforms set.

This is done by applying logic from resolveModuleFromDirIfExists to _resolveStubModuleName:

https://github.com/facebook/jest/blob/bb9efac6c0e5fa3e487d80a639658c29044e081c/packages/jest-resolve/src/index.js#L115-L134

Test plan

Added a test that fails before applying to this fix.

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.

Missing changelog, code LGTM

@SimenB
Copy link
Member

SimenB commented Nov 1, 2018

Needs to update e2e/__tests__/module_name_mapper.test.js's snapshot

@SimenB SimenB merged commit f9fd98f into jestjs:master Nov 1, 2018
@thymikee thymikee deleted the fix/resolve-platform-mapper branch November 9, 2018 19:20
@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 12, 2021
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.

3 participants