Skip to content

test(jest): Fix __mocks__ location#164

Merged
justlevine merged 2 commits intomainfrom
chore--cleanup-merge-artifact
Mar 20, 2026
Merged

test(jest): Fix __mocks__ location#164
justlevine merged 2 commits intomainfrom
chore--cleanup-merge-artifact

Conversation

@justlevine
Copy link
Collaborator

@justlevine justlevine commented Mar 12, 2026

Description

Moves __mocks__ from toplevel to inside tests/js

Technical Details

Checklist

Screenshots

To-do

Fixes/Covers issue

Fixes #

Open WordPress Playground Preview

Copilot AI review requested due to automatic review settings March 12, 2026 20:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes a Jest manual mock file that appears to be a leftover/merge artifact related to @wordpress/api-fetch mocking in JS unit tests.

Changes:

  • Delete the manual Jest mock implementation for @wordpress/api-fetch.
Comments suppressed due to low confidence (1)

mocks/@wordpress/api-fetch.ts:1

  • Unit tests in this repo call Jest-mock methods on the @wordpress/api-fetch import (e.g. mockImplementation, mockResolvedValueOnce, mockReset) without any local jest.mock('@wordpress/api-fetch') in the codebase. If removing this manual mock means apiFetch is no longer provided as a Jest-mockable function by the Jest preset/moduleNameMapper, those tests will fail at runtime (e.g. mockImplementation is not a function). Please double-check the Jest preset still supplies a mock for @wordpress/api-fetch, or restore a local mock / add an explicit jest.mock('@wordpress/api-fetch') setup so apiFetch remains a Jest mock with .use and .createNonceMiddleware available.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@justlevine justlevine force-pushed the chore--cleanup-merge-artifact branch from 329a04d to f4bf0e1 Compare March 12, 2026 22:54
@justlevine justlevine changed the title chore: cleanup merge artifact tests(jest): Fix __mocks__ location Mar 12, 2026
@justlevine justlevine changed the title tests(jest): Fix __mocks__ location test(jest): Fix __mocks__ location Mar 12, 2026
@justlevine justlevine requested a review from Copilot March 12, 2026 22:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@justlevine justlevine requested review from imrraaj and up1512001 March 19, 2026 17:40
@justlevine justlevine merged commit 46ebc2d into main Mar 20, 2026
16 checks passed
@justlevine justlevine deleted the chore--cleanup-merge-artifact branch March 20, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants