Skip to content

test: run keyring-controller on Vitest - #10552

Open
cryptodev-2s wants to merge 1 commit into
test/vitest-setupfrom
test/vitest-keyring-controller
Open

cryptodev-2s wants to merge 1 commit into
test/vitest-setupfrom
test/vitest-keyring-controller

Conversation

@cryptodev-2s

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

Copy link
Copy Markdown
Contributor

Explanation

Moves @metamask/keyring-controller 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).

knip.config.mts gains a uuid ignore: here it is only ever a module name string, in vi.mock and vi.importActual, which knip does not trace. Coverage thresholds restated at measured values. Istanbul on esbuild output counts statements slightly differently from babel on ts-jest output, within about a point.

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-only and build-tooling changes; no production KeyringController runtime behavior is modified.

Overview
@metamask/keyring-controller moves off Jest onto Vitest: jest.config.cjs is removed, vitest.config.mjs is added (with coverage thresholds retuned for Istanbul/esbuild), and package.json test scripts and devDependencies swap Jest for Vitest.

Test code is updated mechanically—jest.* → vi.*, explicit vitest imports (globals off), vi.importActual for the uuid mock, and tsconfig.json sets types: [] so repo-wide Jest types do not apply. Smaller test files and mockErc4337Keyring get the same treatment.

Tooling follows the package: @metamask/keyring-controller is dropped from the Jest workspace list in test-runner-package-map.cjs, knip ignores uuid as a mock module string, and oxlint-suppressions.json drops the deleted Jest config entry and adjusts test-file counts.

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

@cryptodev-2s
cryptodev-2s requested review from a team as code owners 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-keyring-controller branch from 68d12f9 to 675508f Compare September 29, 2026 08:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch 2 times, most recently from 13cd0c5 to 67d664b Compare September 29, 2026 09:02
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch 2 times, most recently from 44ee6e0 to 9f54633 Compare September 29, 2026 14:38
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from 67d664b to 19b538e 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-accounts-controller branch from 19b538e to 3b9fa5f Compare September 30, 2026 07:04
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch 2 times, most recently from 562489c to 5cc065d Compare October 5, 2026 10:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from 3b9fa5f to 2a0fcab Compare October 5, 2026 10:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from 2a0fcab to c101a7a Compare October 12, 2026 14:02
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from 5cc065d to 4e2a256 Compare October 12, 2026 14:02
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from c101a7a to d6f72bf Compare October 12, 2026 15:43
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from 4e2a256 to b5e5992 Compare October 12, 2026 15:43
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from d6f72bf to b73f918 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-keyring-controller branch from b5e5992 to 0e78d97 Compare October 14, 2026 09:24
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from b73f918 to 655bb71 Compare October 14, 2026 12:47
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch 2 times, most recently from 02a0548 to 1ee0916 Compare October 14, 2026 12:53
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from 94f8988 to c0a4cda Compare October 14, 2026 13:44
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from 1ee0916 to 66e6e3a Compare October 14, 2026 13:44
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from eac8ba0 to c533375 Compare October 14, 2026 18:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from bb503c1 to 6af29a3 Compare October 14, 2026 18:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from c533375 to 7d298b8 Compare October 14, 2026 20:18
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from 6af29a3 to ae1b276 Compare October 14, 2026 20:18
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from 7d298b8 to e282b91 Compare October 14, 2026 20:37
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch 2 times, most recently from 9fe575f to 5132c58 Compare October 14, 2026 20:59
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from e282b91 to 0521230 Compare October 14, 2026 20:59
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from 5132c58 to 6020c05 Compare October 14, 2026 21:27
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch 2 times, most recently from c1ad23d to fd6ff54 Compare October 14, 2026 22:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from 6020c05 to c962a7e 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-keyring-controller branch from c962a7e to 828cf37 Compare October 15, 2026 10:36
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch 2 times, most recently from 83be520 to efde443 Compare October 15, 2026 11:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from 828cf37 to 2dcc5b9 Compare October 15, 2026 11:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from efde443 to c0fd4d7 Compare October 15, 2026 11:50
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from 2dcc5b9 to 4fe325d Compare October 15, 2026 11:50
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from c0fd4d7 to b346698 Compare October 15, 2026 12:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from 4fe325d to ae3585d Compare October 15, 2026 12:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from b346698 to a2673d1 Compare October 15, 2026 13:21
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from ae3585d to 4665ce9 Compare October 15, 2026 13:21
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-accounts-controller branch from a2673d1 to f73bc66 Compare October 15, 2026 14:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from 4665ce9 to 83f3081 Compare October 15, 2026 14:48
@cryptodev-2s
cryptodev-2s changed the base branch from test/vitest-accounts-controller to test/vitest-setup October 15, 2026 14:56
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch 2 times, most recently from cf96160 to 656703a Compare October 15, 2026 20:07
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-keyring-controller branch from 656703a to dba4dd3 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