Repository navigation
Test(Integration): migrate test/integration into @wordpress/integration-tests workspace
#77556
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
Changes from 5 commits
5481f09
467ef0d
ec831fb
74a1db4
5ca2575
6db2777
14adcdf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Integration Tests | ||
|
|
||
| This directory contains the integration test suite for the Gutenberg project, published as the `@wordpress/integration-tests` workspace package. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not published. |
||
|
|
||
| ## What Are Integration Tests? | ||
|
|
||
| Unlike unit tests that test individual functions in isolation, these tests exercise multiple packages working together. They cover: | ||
|
|
||
| | Test file | What it tests | | ||
| |---|---| | ||
| | `blocks-schema.test.js` | Validates all `block.json` files in the repo against the JSON schema | | ||
| | `theme-schema.test.js` | Validates all `theme.json` files in the repo against the JSON schema | | ||
| | `wp-env-schema.test.js` | Validates `.wp-env.json` against the JSON schema | | ||
| | `blocks-raw-handling.test.js` | Tests raw paste/HTML handling across the full block pipeline | | ||
| | `full-content/full-content.test.js` | Tests full block serialization round-trips using fixtures | | ||
| | `is-valid-block.test.js` | Tests block validation with editor hooks applied | | ||
| | `shortcode-converter.test.js` | Tests shortcode-to-block conversion | | ||
| | `non-matched-tags-handling.test.js` | Tests handling of unrecognized HTML tags during paste | | ||
|
|
||
| ## Running the Tests | ||
|
|
||
| Integration tests run as part of the standard unit test command: | ||
|
|
||
| ```bash | ||
| npm run test:unit | ||
| ``` | ||
|
|
||
| To run only the integration tests: | ||
|
|
||
| ```bash | ||
| npm run test:unit -- test/integration | ||
| ``` | ||
|
|
||
| To run a specific integration test file: | ||
|
|
||
| ```bash | ||
| npm run test:unit -- test/integration/blocks-schema.test.js | ||
| ``` | ||
|
|
||
| ## Fixtures | ||
|
|
||
| The `fixtures/blocks/` directory contains serialized block fixtures used by `full-content.test.js` to verify that blocks serialize and parse correctly. | ||
|
|
||
| To generate missing fixtures: | ||
|
|
||
| ```bash | ||
| npm run fixtures:generate | ||
| ``` | ||
|
|
||
| To regenerate all fixtures from scratch: | ||
|
|
||
| ```bash | ||
| npm run fixtures:regenerate | ||
| ``` | ||
|
|
||
| ## Jest Configuration | ||
|
|
||
| These tests reuse the Jest configuration from `test/unit/jest.config.js`. There is no separate Jest config in this directory — `test/unit`'s config sets `rootDir` to the repo root, which automatically discovers tests in this directory. | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||||||||||||||||
| { | ||||||||||||||||||||
| "name": "@wordpress/integration-tests", | ||||||||||||||||||||
| "version": "0.0.0", | ||||||||||||||||||||
| "description": "Integration tests for WordPress Gutenberg.", | ||||||||||||||||||||
| "private": true, | ||||||||||||||||||||
| "author": "The WordPress Contributors", | ||||||||||||||||||||
| "license": "GPL-2.0-or-later", | ||||||||||||||||||||
| "keywords": [ | ||||||||||||||||||||
| "wordpress", | ||||||||||||||||||||
| "gutenberg", | ||||||||||||||||||||
| "integration-tests" | ||||||||||||||||||||
| ], | ||||||||||||||||||||
| "homepage": "https://github.com/WordPress/gutenberg/tree/HEAD/test/integration/README.md", | ||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file doesn't exist. Let us create one.
|
||||||||||||||||||||
| "homepage": "https://github.com/WordPress/gutenberg/tree/HEAD/test/integration/README.md", | |
| "homepage": "https://github.com/WordPress/gutenberg/tree/HEAD/test/integration/", |
Copilot
AI
Apr 22, 2026
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.
Other test workspaces define workspace-scoped scripts and include the runner dependency they use (e.g. @wordpress/unit-tests includes @wordpress/scripts and test:unit* scripts in test/unit/package.json:22-48, and e2e/performance do similarly). This new @wordpress/integration-tests package currently has no scripts and no @wordpress/scripts; if the intent is to run integration tests independently via npm run --workspace @wordpress/integration-tests …, add the corresponding scripts and required devDependencies to match that established pattern.
| }, | |
| "devDependencies": { | |
| }, | |
| "scripts": { | |
| "test:integration": "wp-scripts test-unit-js", | |
| "test:integration:watch": "npm run test:integration -- --watch" | |
| }, | |
| "devDependencies": { | |
| "@wordpress/scripts": "^30.13.0", |
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.
Let us ensure that we declare all the dependencies that the workspace uses.
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.
Also, agv can be removed from root package.json
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.
PR description mentions adding
test:integration/watch/debug scripts and atest/integration/jest.config.js, but those changes aren’t present (root scripts still only include unit-test runners, andtest/integration/has no jest config). Either update the PR description or include the missing script/config changes so the workspace can actually be executed independently as described.