-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Upgrade Jest from 27 to 29.5.0 #47388
Conversation
I think what we could do is cherry-pick that change into the fork, that would be quicker than updating to a newer version as that requires more work and a lot of testing. |
That would be awesome. The issue is that Jest's |
Cool! I'll find some time to cherry-pick that and bump the Reanimated version, I'll let you know once it is ready 👍 |
da91d40
to
9bb437b
Compare
Hey @jsnajdr 👋 I'm working on a draft PR that will update the Reanimated version. In the meantime, you could try pointing to this version and see if this issue is resolved. Thanks! |
Hey there 👋 The Reanimated update is now merged in |
db6b79b
to
047dd5d
Compare
Thanks for the update @geriux, it really fixed a lot of failures in this branch. Turns out we need to cherry-pick one more patch for export * as default from './Animated'; This syntax is however not supported without an extra Babel plugin, so we need to rewrite it to: import * as Animated from './Animated';
export default Animated; In the upstream |
047dd5d
to
99bfa7f
Compare
Size Change: 0 B Total Size: 1.34 MB ℹ️ View Unchanged
|
5373ac3
to
5353037
Compare
Flaky tests detected in 3269e11cc6f542310d2edd5caea67527cb2578e1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4362681327
|
0529a8e
to
d2d52d3
Compare
I did some final updates for the PR:
@tyxla @gziolo If the CI checks come back as green, could you do a final review of this upgrade? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I don't have the knowledge to review some of the changes related to React Native and the custom resolver that seems to be targeting ES Modules in node_modules
. However, everything is green on CI and the part for the web looks excellent. Great work on that upgrade!
@@ -24,7 +24,6 @@ module.exports = { | |||
'**/?(*.)test.[jt]s?(x)', | |||
], | |||
testPathIgnorePatterns: [ '/node_modules/', '<rootDir>/vendor/' ], | |||
timers: 'real', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works around an issue where the new Jest tries to use the The fixes I did were inspired by this very thoughtful comment in another project that did the Jest 29 upgrade last year: microsoft/accessibility-insights-web#5421 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thank you @jsnajdr 🙌
After merge, CI checks are failing because |
Most likely nothing to worry about. It often happens after updating the lock file. I believe it's a cache issue and restarting failed jobs helps. See #33424 for some similar issues in the past. |
Happy to hear that 🙂 Locally, running |
Updated my
|
Hi @ktmn 👋 You're running into an issue with https://github.com/WordPress/gutenberg/blob/trunk/test/unit/scripts/resolver.js#L10-L22 One way how to solve it is to upgrade If that doesn't work, we should probably include the custom Jest resolver that works around these issues in the Jest config for |
This is an upgrade of Jest from v27 to v29, two major versions up. There's been a lot of breaking changes, so it's a big and difficult PR.
At this moment, web unit tests are all green, mobile tests still need some fixing.
One thing that's broken in mobile tests are Jest helpers imported from
react-native-reanimated
. Gutenberg uses a fork ofreact-native-reanimated
. For the Jest update, we need to incorporate changes from this PR: software-mansion/react-native-reanimated#3559. @geriux would it be possible to update the fork? Currently the fork is based on upstream version 2.9.1 (Jul 2022), the Jest helper issue (expect.extend
) has been fixed in version 2.13.0 (Nov 2022) and the latest version is 2.14.4 (Jan 2022, two weeks ago)