-
-
Notifications
You must be signed in to change notification settings - Fork 275
accounts-controller: Move mocks out of build#8033
Merged
Conversation
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).
salimtb
salimtb
approved these changes
Feb 24, 2026
gantunesr
gantunesr
approved these changes
Feb 24, 2026
Member
@gantunesr
gantunesr
left a comment
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.
Approved for Accounts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Explanation
Currently, the published version of
@metamask/accounts-controllercontains 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-controllerhere: #7925Manual testing steps
Run
yarn build:cleanand openpackages/accounts-controller/dist. You should not see amocksdirectory in there.Checklist
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-controllertest mocks out ofsrcinto a new top-leveltests/folder so they are no longer included in the published/build output.Updates
accounts-controllerTypeScript/Jest configuration accordingly (remove coverage ignore forsrc/tests, include./testsintsconfig) and adjusts all downstream test imports inassets-controllersto 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.