Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

accounts-controller: Move mocks out of build#8033

Merged
mcmire merged 2 commits intomain from
move-mocks-out-of-build
Feb 24, 2026
Merged

accounts-controller: Move mocks out of build #8033
mcmire merged 2 commits intomain from
move-mocks-out-of-build

Conversation

@mcmire
Copy link
Contributor

@mcmire mcmire commented Feb 24, 2026
edited by cursor bot
Loading

Explanation

Currently, the published version of @metamask/accounts-controller contains helper functions that are only used in tests to create mock objects.

This commit moves them out of the build. It also removes tests for these helpers (as they are implicitly tested by the fact that they are used in tests).

References

A similar change was made for @metamask/gator-permissions-controller here: #7925

Manual testing steps

Run yarn build:clean and open packages/accounts-controller/dist. You should not see a mocks directory in there.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Test-only refactor that relocates mocks and updates test imports/config without changing runtime controller logic; main risk is broken test/build paths if any import was missed.

Overview
Moves @metamask/accounts-controller test mocks out of src into a new top-level tests/ folder so they are no longer included in the published/build output.

Updates accounts-controller TypeScript/Jest configuration accordingly (remove coverage ignore for src/tests, include ./tests in tsconfig) and adjusts all downstream test imports in assets-controllers to reference the new mocks location; also removes the dedicated unit test file for the mocks.

Written by Cursor Bugbot for commit 1723548. This will update automatically on new commits. Configure here.

Currently, the published version of `@metamask/accounts-controller`
contains helper functions that are only used in tests to create mock
objects.
This commit moves them out of the build. It also removes tests for these
helpers (as they are implicitly tested by the fact that they are used in
tests).
@mcmire mcmire marked this pull request as ready for review February 24, 2026 14:51
@mcmire mcmire requested review from a team as code owners February 24, 2026 14:51
Copy link
Member

@gantunesr gantunesr left a comment

Choose a reason for hiding this comment

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

Approved for Accounts

@mcmire mcmire added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit a43d616 Feb 24, 2026
310 checks passed
@mcmire mcmire deleted the move-mocks-out-of-build branch February 24, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gantunesr gantunesr gantunesr approved these changes

@salimtb salimtb salimtb approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /