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

Comments

Exclude test folder from @metamask/gator-permissions-controller build artifact#7925

Open
jeffsmale90 wants to merge 1 commit intomain from
chore/exclude_test_from_build
Open

Exclude test folder from @metamask/gator-permissions-controller build artifact #7925
jeffsmale90 wants to merge 1 commit intomain from
chore/exclude_test_from_build

Conversation

@jeffsmale90
Copy link
Contributor

@jeffsmale90 jeffsmale90 commented Feb 12, 2026
edited by cursor bot
Loading

Explanation

Moves /src/test to /tests so that mock data is not included in build artifact. Also updates tsconfig so that /tests folder is build and can be referenced from within *.test.ts files.

References

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 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-controller test infrastructure to keep mock data out of the published build by relocating mocks to top-level tests/ and updating unit tests to import from the new location.

Adjusts TypeScript project config to include ./tests for compilation/typechecking, and fixes test imports in errors.test.ts/tests/mocks.ts to reference src modules correctly.

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

@jeffsmale90 jeffsmale90 requested a review from a team as a code owner February 12, 2026 23:33
Copy link

@cursor cursor bot left a 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 marked this pull request as draft February 17, 2026 05:26
@jeffsmale90 jeffsmale90 force-pushed the chore/exclude_test_from_build branch from 59285bc to 9f668b1 Compare February 20, 2026 00:49
@jeffsmale90 jeffsmale90 marked this pull request as ready for review February 20, 2026 00:49
@jeffsmale90 jeffsmale90 marked this pull request as draft February 20, 2026 00:55
@jeffsmale90 jeffsmale90 force-pushed the chore/exclude_test_from_build branch 2 times, most recently from 1c8ba3b to c34d417 Compare February 24, 2026 00:50
@jeffsmale90 jeffsmale90 marked this pull request as ready for review February 24, 2026 00:51
Copy link
Contributor

@mcmire mcmire left a 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!

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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments

@mcmire mcmire mcmire approved these changes

@mj-kiwi mj-kiwi mj-kiwi approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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