Tests: Add timezone-mock to test/unit/package.json#78277
Conversation
The Jest global setup in `test/unit/config/global-mocks.js` imports `timezone-mock` directly, so declare it as a devDependency of the unit-tests package rather than relying on a transitive resolution from `@wordpress/components`. Follow-up to #78056.
|
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. |
|
Size Change: 0 B Total Size: 7.95 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 792f83a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25851750905
|

What?
Follow-up to #78056.
Adds
timezone-mockas an explicitdevDependencyof the@wordpress/unit-testspackage (test/unit/package.json).Why?
In #78056 the global Jest setup at
test/unit/config/global-mocks.jswas updated toimport timezoneMock from 'timezone-mock'so that afallbackFncould be configured forMockDate. However, the dependency was only declared inpackages/components/package.json(where it had previously been used directly by the date-time tests).As pointed out in review by @manzoorwanijk, the package that actually imports the module should declare it. This keeps the dependency graph honest and avoids relying on hoisting from another workspace package.
How?
"timezone-mock": "^1.3.6"to thedevDependenciesoftest/unit/package.json(matching the version already declared by@wordpress/components).package-lock.jsonaccordingly (no version change; only the workspace's declareddevDependenciesblock is updated).Testing Instructions
npm run test:unit -- packages/components/src/date-timetimezone-mock.Testing Instructions for Keyboard
N/A — test infrastructure change only.
Screenshots or screencast
N/A
Use of AI Tools
This pull request was authored with the assistance of Claude Opus 4.7, used to confirm the location of the
timezone-mockimport and to draft this PR addressing the follow-up review feedback.