Repository navigation
Tests: Isolate deprecation warning state - #83107
Conversation
🤖 PR meta 🤖📦 Bundle sizeSize Change: 0 B Total Size: 8.22 MB
|
0dda13d to
d903469
Compare
570f196 to
2655c4a
Compare
d903469 to
b2c7cd3
Compare
2655c4a to
490c254
Compare
490c254 to
ac636f8
Compare
b2c7cd3 to
829bb05
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Mamaduka
left a comment
There was a problem hiding this comment.
Maybe we should add something about unit testing deprecations to the package's README file.
|
|
||
| <!-- END TOKEN(Autogenerated API docs) --> | ||
|
|
||
| ## Unit testing deprecations |
There was a problem hiding this comment.
I'll actually apply this guidance elsewhere in the repo in this PR, while I'm at it.
* Data: Isolate registerGenericStore warning tests * Deprecated: Document unit testing deprecation warnings * Tests: Scope deprecation cleanup to each suite --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Follow up to #80855.
What?
Isolate deprecation warning state in tests across
data,block-editor,components,compose, andinterface, and document the patterns in@wordpress/deprecated.Why?
Deprecation messages are logged once. With shuffle seed 80856, an earlier registry test consumed the
registerGenericStorewarning before the test that expected it. Several other suites also cleared unrelated deprecation state or left their own messages behind.How?
The registry suite suppresses its expected deprecation except when asserting the warning. Other suites clear only their own messages before and after tests, preserve warning assertions, and check exact text where applicable. Remove obsolete cleanup from the font-size utility tests and add README examples for both patterns.
Testing Instructions
Run the affected suites with shuffled files and tests. All warning assertions and behavior checks should pass regardless of execution order.
Testing Instructions for Keyboard
Not applicable; this changes tests and documentation only.
Verification
All 341 affected tests passed with seed 80856, including 11 Chromium tests. Type checking, the full build, documentation generation, and commit hooks passed. JavaScript lint reported no errors and existing assertion warnings. Markdown lint reports three existing issues in the README's autogenerated API section.
Use of AI Tools
Codex helped reproduce the seeded failure, implement and document the cleanup, investigate CI, and run verification.