Migrate Block Library Tests to Vitest - #80972
Closed
ciampo wants to merge 1 commit into
Closed
Conversation
1 task
|
Size Change: 0 B Total Size: 7.76 MB |
|
Flaky tests detected in 750ee7a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/30550479595
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
See #80855.
TL;DR: This slice migrates Block Library's 55 unit-test files from Jest to Vitest. The required change classes are explicit Vitest imports, ESM-compatible dynamic mock factories, the Vitest Testing Library matcher entrypoint, shared integration fake-timer helpers, and an audited snapshot key/header update.
Why?
Block Library was one of the four remaining Jest-owned areas in the repository. Migrating it reduces the residual Jest partition while preserving the package's 669 tests and its existing Testing Library-based authoring model.
How?
packages/block-librarythrough the private Vitestjsdomproject.requirecalls with explicit Vitest imports and ESM-compatible mocks.@testing-library/reactand@testing-library/user-event; only the matcher registration changes to@testing-library/jest-dom/vitest.Testing Instructions
npm run test:unit:vitest -- packages/block-librarynpm run test:unit:vitestnpm run test:unit -- --runInBandnpm run test:unit:validate-migrationnpm run test:unit:validate-vitest-conventionsTesting Instructions for Keyboard
Not applicable; this changes test infrastructure only.
Screenshots or screencast
Not applicable.
Use of AI Tools
This migration was implemented with Codex assistance. The resulting diff, snapshot, and verification output were reviewed before publication.