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
Update to Jest 28 #11387
Update to Jest 28 #11387
Conversation
ccb993e
to
e124e4e
Compare
e124e4e
to
5e44f06
Compare
# Conflicts: # package-lock.json
Size Change: 0 B Total Size: 2.61 MB ℹ️ View Unchanged
|
Plugin builds for efbe101 are ready 🛎️!
|
packages/story-editor/src/components/checklist/countContext/test/checkCountContext.js
Show resolved
Hide resolved
# Conflicts: # package-lock.json # package.json # packages/dashboard/package.json # packages/story-editor/package.json
await page.waitForFunction( | ||
() => | ||
wp.data.select('core/editor').getEditedPostAttribute('status') === | ||
'publish' | ||
); |
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.
Can you give some more details here?
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.
Previously this util just checked for wp.data.select('core/editor').getPermalink()
and that it doesn't return null
. If it returns a truthy value (e.g. the permalink string), we assumed the post was published.
But apparently nowadays wp.data.select('core/editor').getPermalink()
always returns a string with the permalink, even if the post is still a draft.
We now wait for the post status to actually change and for the "View Post" link to appear, so that we are more certain that the post was actually published.
Context
Jest v28 has built-in support for sharding.
Summary
Updates Jest to v28 and follows the upgrade guide to update the test configuration.
Relevant Technical Choices
jest-parallell-sequencer
packageexports
resolver workarounds for two packages with known incompatibilities@wordpress/jest-console
from JS unit tests, as this more meant for e2e test contextChecklistCategoryProvider
test to spy onconsole.error
to keep the logs cleanTo-do
User-facing changes
Testing Instructions
This PR can be tested by following these steps:
Reviews
Does this PR have a security-related impact?
Does this PR change what data or activity we track or use?
Does this PR have a legal-related impact?
Checklist
Type: XYZ
label to the PRFixes #10843