Skip to content

test: run sample-controllers on Vitest - #10550

Open
cryptodev-2s wants to merge 1 commit into
test/vitest-setupfrom
test/vitest-sample-controllers
Open

cryptodev-2s wants to merge 1 commit into
test/vitest-setupfrom
test/vitest-sample-controllers

Conversation

@cryptodev-2s

@cryptodev-2s cryptodev-2s commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

Moves @metamask/sample-controllers to Vitest. One of a stack on top of #10546, which added Vitest without migrating anything.

Add vitest.config.mts, delete jest.config.cjs, swap the test scripts and dev dependencies, point the package tsconfig off the repo wide types: ["jest"], and rewrite the test files (jest.* to vi.*, jest.Mocked to the imported Vitest type, requireActual to an awaited importActual, and an explicit vitest import per file since globals is off).

Tests pass with coverage thresholds enforced. yarn lint and yarn constraints are green on this branch alone.

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
    • Not applicable, test only change. Carries the no-changelog label.
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them
    • None.

Note

Low Risk
Test infrastructure and devDependencies only; library behavior and public API are unchanged.

Overview
Migrates @metamask/sample-controllers from Jest to Vitest as the first package on the shared Vitest setup (stacked on the repo-wide Vitest foundation).

The package drops jest.config.cjs and adds vitest.config.mjs (merged from vitest.config.packages.mjs) with the same 100% coverage thresholds. package.json switches test / test:watch / related scripts to Vitest and swaps Jest devDependencies for vitest.

Test-only updates: explicit vitest imports (globals off), jest.* → vi.* for mocks/timers/spies, and flushPromises from tests/vitest/helpers.js. tsconfig.json sets types: [] so repo-wide Jest types do not apply. @metamask/sample-controllers is removed from test-runner-package-map.cjs (no longer run as a Jest package). oxlint-suppressions.json is updated for the new test file lint entries.

No production/runtime code changes.

Reviewed by Cursor Bugbot for commit 1cb5369. Bugbot is set up for automated code reviews on this repo. Configure here.

@cryptodev-2s
cryptodev-2s requested a review from a team as a code owner September 28, 2026 20:18
@cryptodev-2s
cryptodev-2s added this pull request to stack #10557 September 28, 2026 20:19
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from 57a9877 to e91bdd0 Compare September 29, 2026 08:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch 2 times, most recently from 67053a2 to b3e82c5 Compare September 29, 2026 09:02
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch 2 times, most recently from ad263be to c679083 Compare September 29, 2026 14:38
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch from b3e82c5 to a1d4e04 Compare September 29, 2026 14:38
@cryptodev-2s
cryptodev-2s removed this pull request from stack #10557 September 29, 2026 14:40
@cryptodev-2s
cryptodev-2s added this pull request to stack #10578 September 29, 2026 14:41
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from c679083 to 80c7790 Compare September 30, 2026 07:04
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch 2 times, most recently from 364aa75 to 63eccab Compare October 5, 2026 10:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from 80c7790 to 23f8c46 Compare October 5, 2026 10:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from 23f8c46 to dffdbe0 Compare October 12, 2026 14:02
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch from 63eccab to 71c2fed Compare October 12, 2026 14:02
@socket-security

socket-security Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from dffdbe0 to fe8b81c Compare October 12, 2026 15:43
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch from 71c2fed to 326b876 Compare October 12, 2026 15:43
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from fe8b81c to 4c4749e Compare October 14, 2026 09:23
@cryptodev-2s
cryptodev-2s requested review from a team as code owners October 14, 2026 09:23
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch from 326b876 to 253b29c Compare October 14, 2026 09:23
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from 4c4749e to 642b296 Compare October 14, 2026 12:47
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch 2 times, most recently from bfbd149 to 0ca3777 Compare October 14, 2026 12:53
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from d3960d8 to 8112a4b Compare October 14, 2026 13:44
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch from 0ca3777 to ac3840f Compare October 14, 2026 13:44
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from b549cff to 9373d55 Compare October 14, 2026 18:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch from a0a00fc to 9be48e8 Compare October 14, 2026 18:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from 9373d55 to b2c633b Compare October 14, 2026 20:18
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch from 9be48e8 to 7d3768b Compare October 14, 2026 20:18
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from b2c633b to acb7896 Compare October 14, 2026 20:37
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch 2 times, most recently from 60962aa to fa046eb Compare October 14, 2026 20:59
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from acb7896 to 2369da2 Compare October 14, 2026 20:59
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch from fa046eb to f9f28e3 Compare October 14, 2026 21:27
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch 2 times, most recently from 68df0bc to e32a39c Compare October 14, 2026 22:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch from f9f28e3 to 7e7d023 Compare October 14, 2026 22:48
@cryptodev-2s
cryptodev-2s removed this pull request from stack #10578 October 14, 2026 22:51
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from e32a39c to d168357 Compare October 15, 2026 10:36
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch from 7e7d023 to 0b21fde Compare October 15, 2026 10:36
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from d168357 to e25274a Compare October 15, 2026 11:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch 2 times, most recently from a196bd2 to 8e3abbd Compare October 15, 2026 11:50
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch 2 times, most recently from 4b735f3 to 8b861e8 Compare October 15, 2026 12:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch 2 times, most recently from 56d6d16 to fe67e0d Compare October 15, 2026 13:21
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from 8b861e8 to 55fa07c Compare October 15, 2026 13:21
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch from fe67e0d to d7f992a Compare October 15, 2026 14:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-approval-controller branch from 55fa07c to b9164d4 Compare October 15, 2026 14:48
@cryptodev-2s
cryptodev-2s changed the base branch from test/vitest-approval-controller to test/vitest-setup October 15, 2026 14:56
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch 2 times, most recently from 46d275e to 36e6deb Compare October 15, 2026 20:07
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-sample-controllers branch from 36e6deb to 1cb5369 Compare October 15, 2026 23:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant