-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Scripts: Jest error when running e2e tests #42126
Comments
Seems like the issue is that
Overriding the version in
|
Hi, I have forked your repository and tested it, and I think the following steps will work.
|
I have tried these steps before and it didn't work, you'll end up with the same situation of mixed Jest versions. |
Can you test my repository with the forked and modified version? |
Ah, you're using an older version of npm, that's why. I'm using npm 8. |
Yes, node 16.x and npm 6.x would be recommended. |
Do you think limiting the node version is a fundamental solution to this issue? I have confirmed that engines allow npm 8 in each package of gutenberg. {
"engines": {
"npm": ">=6.9.0 <7"
}
} Should we introduce version restrictions in each package to prevent errors like this one? I would like to hear your thoughts. |
Limiting the npm version is just a hacky way to work around the Jest version constraint and would seriously hinder any modern project from using Gutenberg packages, so a big -1 from me on that approach. IMO the "proper" solution is to ensure that all packages can easily use the same Jest version. Adding it to Of course updating the version constraint also helps. Sharing the link to our Slack discussion for context: https://wordpress.slack.com/archives/C02QB2JS7/p1657609316323339 |
Agreed. If you don't mind, would it be possible to start a new issue? As far as the following PRs are concerned, the method of unifying with version 27 may be appropriate, since Jest's version upgrade has a large impact: |
Closing this issue - as the PRs mentioned above seem complete, and there's been no further movement on this in 12 months. |
I also think this issue should be closed. In the latest Gutenberg, all packages seem to depend on Jest version 29. npm ls jest
[email protected] /home/path/to/gutenberg
├─┬ @testing-library/[email protected]
│ └── [email protected] deduped
├─┬ @wordpress/[email protected] -> ./packages/e2e-test-utils
│ └── [email protected] deduped
├─┬ @wordpress/[email protected] -> ./packages/e2e-tests
│ └── [email protected] deduped
├─┬ @wordpress/[email protected] -> ./packages/jest-console
│ └── [email protected] deduped
├─┬ @wordpress/[email protected] -> ./packages/jest-preset-default
│ └── [email protected] deduped
├─┬ @wordpress/[email protected] -> ./packages/jest-puppeteer-axe
│ └── [email protected] deduped
├─┬ @wordpress/[email protected] -> ./packages/scripts
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├── [email protected]
└─┬ [email protected]
└── [email protected] deduped |
Description
For the Preferred Languages feature plugin I am currently using
"@wordpress/e2e-test-utils": "^7.8.0"
,"@wordpress/env": "^4.9.0"
and"@wordpress/scripts": "^23.4.0"
, with no custom configurations or anything.When running
wp-scripts test-e2e
all my tests now fail with the following error:Example run: https://github.com/swissspidy/preferred-languages/runs/7181995299?check_suite_focus=true
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: