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-resolve): disable jest-pnp-resolver for Yarn 2 #10847

Merged
merged 2 commits into from Nov 20, 2020

Conversation

merceyz
Copy link
Contributor

@merceyz merceyz commented Nov 18, 2020

Summary

In #9520 jest-resolve was switched to use resolve which, because Yarn 2 patches it, supports PnP. This makes jest-pnp-resolver unnecessary but it can't be removed as that would be a breaking change for Yarn 1 PnP users but it can be disabled for Yarn 2.

Main reason for doing this is that jest-pnp-resolver doesn't support projects where there are multiple pnpapi instances but the patch in resolve does.

Test plan

Tests should still pass

Copy link
Contributor

@jeysal jeysal left a comment

Choose a reason for hiding this comment

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

Nothing unusual in the code and given this comes from someone involved in Yarn and Maël has +1ed, I'll just trust the reasoning behind it :D
We also have e2e tests I think soooo...

@SimenB
Copy link
Member

SimenB commented Nov 19, 2020

Yay! 🎉

The PnP integration test fails on CI, tho.

Also, can you remove https://github.com/facebook/jest/blob/a66eec74b55dc98ab072be330c13c54c35cba5f7/packages/jest-resolve/src/defaultResolver.ts#L26-L33?

@merceyz merceyz changed the title fix(jest-resolve): remove unnecessary dependency jest-pnp-resolver fix(jest-resolve): disable jest-pnp-resolver for Yarn 2 Nov 19, 2020
@merceyz
Copy link
Contributor Author

merceyz commented Nov 19, 2020

I can't actually remove the plugin as that would be a breaking change for Yarn 1 PnP users, so instead I disabled it for Yarn 2. I updated the test and it passes locally so lets hope the CI agrees

@SimenB
Copy link
Member

SimenB commented Nov 20, 2020

👍

We could consider dropping v1 support in a future major

@SimenB SimenB merged commit ff2b65c into jestjs:master Nov 20, 2020
@merceyz merceyz deleted the merceyz/pnp-fix branch November 20, 2020 07:51
@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 11, 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.

None yet

4 participants