-
-
Notifications
You must be signed in to change notification settings - Fork 275
Comments
Exclude test folder from @metamask/gator-permissions-controller build artifact#7925
Open
jeffsmale90 wants to merge 1 commit intomain from
Open
Exclude test folder from @metamask/gator-permissions-controller build artifact #7925jeffsmale90 wants to merge 1 commit intomain from
@metamask/gator-permissions-controller build artifact #7925jeffsmale90 wants to merge 1 commit intomain from
Conversation
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
@jeffsmale90
jeffsmale90
force-pushed
the
chore/exclude_test_from_build
branch
from
February 20, 2026 00:49
59285bc to
9f668b1
Compare
@jeffsmale90
jeffsmale90
force-pushed
the
chore/exclude_test_from_build
branch
2 times, most recently
from
February 24, 2026 00:50
1c8ba3b to
c34d417
Compare
...e tsconfig to include mocks in typescript build.
@jeffsmale90
jeffsmale90
force-pushed
the
chore/exclude_test_from_build
branch
from
February 24, 2026 00:51
c34d417 to
251170c
Compare
mcmire
mcmire
approved these changes
Feb 24, 2026
Contributor
@mcmire
mcmire
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.
Ran yarn build and can confirm that mocks no longer show up in dist. Thanks for taking care of this!
4 tasks
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 24, 2026
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> 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 <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> 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 - [x] 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](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!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. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1723548. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
mj-kiwi
mj-kiwi
approved these changes
Feb 24, 2026
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
Moves
/src/testto/testsso that mock data is not included in build artifact. Also updates tsconfig so that/testsfolder is build and can be referenced from within*.test.tsfiles.References
Checklist
Note
Low Risk
Test-only path/config changes; runtime code is unchanged, with main risk being broken test/build resolution if imports or tsconfig paths are misconfigured.
Overview
Updates
@metamask/gator-permissions-controllertest infrastructure to keep mock data out of the published build by relocating mocks to top-leveltests/and updating unit tests to import from the new location.Adjusts TypeScript project config to include
./testsfor compilation/typechecking, and fixes test imports inerrors.test.ts/tests/mocks.tsto referencesrcmodules correctly.Written by Cursor Bugbot for commit 251170c. This will update automatically on new commits. Configure here.