Repository navigation
Conversation
18 of 41 tasks
|
Size Change: 0 B Total Size: 7.76 MB |
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?
Part of #80855. Stacked on #80878; review commit
1daffed73db.TL;DR — canonical authoring and type-graph guardrails: adds a CI validator for ESM-only Vitest tests, explicit runner imports, dynamic-import TypeScript mocks, workspace-owned Vitest dependencies, version consistency, and complete migrated TS/TSX test type-checking.
Why?
Passing tests alone does not prove the intended native-Vitest end state. Normal package builds also exclude some test directories, so migrated TypeScript tests could execute while retaining type errors or untyped mocks. This PR makes the canonical conventions in #80855 executable gates before larger package migrations.
How?
The validator:
require()in the authored Vitest graph;vitest/globals;vi.mock()calls to usevi.mock(import(...));devDependencies.vitestversion;The clean CI job first runs the repository's standard custom workspace builds (including generated Icons exports), then generates the official Vips/video-conversion worker placeholders and package declarations before validating the test-only TypeScript graph. This preserves real workspace types without pulling unrelated package source into the isolated test project or relying on local build artifacts.
Enabling the type graph exposed and fixed type-only gaps in existing migrated tests: complete Abilities reducer fixtures, explicit invalid-input boundaries, an ambiguous empty array, two
useResizeObservermocks, and the narrow selector contract used from untyped@wordpress/commands.@wordpress/commandsremains an explicit compatibility declaration because that JavaScript package does not publish types. No production code, runner ownership, or snapshots change.Testing Instructions
npx lerna run buildnpm run --workspace @wordpress/build-scripts generate-worker-placeholdersnpx tsc --buildnpm run test:unit:conventionsnpm run test:unit:routingnpm run test:unit:vitestnpm run lint:pkg-json,npm run lint:lockfile, andnpm run lint:tsconfig.npm run lint:depscontinues to report only the repository's pre-existing@babel/coreandyargsversion drift.Testing Instructions for Keyboard
Not applicable; production behavior is unchanged.
Screenshots or screencast
Not applicable.
Use of AI Tools
AI tools helped implement and adversarially exercise the validator, reproduce clean-CI failures, add the official generated prerequisites, and run deterministic verification.