Skip to content

fix(jest-resolve): disable jest-pnp-resolver for Yarn 2#10847

Merged
SimenB merged 2 commits intojestjs:masterfrom
merceyz:merceyz/pnp-fix
Nov 20, 2020
Merged

fix(jest-resolve): disable jest-pnp-resolver for Yarn 2#10847
SimenB merged 2 commits intojestjs:masterfrom
merceyz:merceyz/pnp-fix

Conversation

@merceyz
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

@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
Copy Markdown
Member

SimenB commented Nov 19, 2020

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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.

4 participants