Skip to content

test: run polling-controller on Vitest - #10548

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

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

Conversation

@cryptodev-2s

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

Copy link
Copy Markdown
Contributor

Explanation

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

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-runner and devDependency changes only; runtime package code is unchanged.

Overview
Migrates @metamask/polling-controller from Jest to Vitest as part of the repo-wide test runner rollout.

Test tooling: Removes jest.config.cjs and Jest-related devDependencies; adds vitest.config.mjs (merged with the shared package config) with the same coverage thresholds as before. Package test scripts now invoke Vitest (vitest run, watch, etc.).

Tests: StaticIntervalPollingController.test.ts switches to explicit Vitest imports (vi, describe, …), vi.fn() / fake timers instead of Jest, and shared advanceTime from tests/vitest/helpers.js instead of jestAdvanceTime.

TypeScript / CI wiring: Package tsconfig.json sets compilerOptions.types to [] so repo-wide Jest types are not pulled in. @metamask/polling-controller is dropped from PACKAGES_ON_JEST in test-runners.cjs, and the obsolete jest.config.cjs oxlint suppression is removed.

No production controller source changes in this diff—only test and config updates.

Reviewed by Cursor Bugbot for commit 6ca0307. 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-polling-controller branch from c4fcfb2 to 54879b9 Compare September 29, 2026 08:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from 32d3ba1 to 452938a Compare September 29, 2026 08:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from 54879b9 to 79b9e14 Compare September 29, 2026 09:02
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch 2 times, most recently from 0fee19b to c1e577a Compare September 29, 2026 14:38
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from 79b9e14 to 12980e9 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-polling-controller branch from 12980e9 to d248c2e Compare September 30, 2026 07:04
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from c1e577a to 021450c Compare September 30, 2026 07:04
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from d248c2e to dbc8afc Compare October 5, 2026 10:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from 021450c to 26238b4 Compare October 5, 2026 10:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from dbc8afc to 79ecc80 Compare October 12, 2026 14:02
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch 2 times, most recently from 5dd5aff to e5b70e8 Compare October 12, 2026 15:43
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from 79ecc80 to 56ec0c8 Compare October 12, 2026 15:43
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from e5b70e8 to 353997d 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-polling-controller branch from 56ec0c8 to 0027854 Compare October 14, 2026 09:23
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from 353997d to cfedd2a Compare October 14, 2026 12:47
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch 2 times, most recently from 52c697b to 342e176 Compare October 14, 2026 12:53
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from aece612 to 860b7b9 Compare October 14, 2026 13:44
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from 342e176 to 09e3b96 Compare October 14, 2026 13:44
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from 860b7b9 to 1a307d4 Compare October 14, 2026 15:41
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from 14923d7 to bf6fb8a Compare October 14, 2026 17:53
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch 2 times, most recently from 30e1dbc to 444c0a0 Compare October 14, 2026 18:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from bf6fb8a to 2d85bf5 Compare October 14, 2026 18:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from 444c0a0 to 80d5b4d Compare October 14, 2026 20:18
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch 2 times, most recently from 3657884 to 72146c5 Compare October 14, 2026 20:37
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch 2 times, most recently from 7d84ca4 to 5f28508 Compare October 14, 2026 20:59
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from 72146c5 to 85f9712 Compare October 14, 2026 20:59
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from 5f28508 to dee3bae Compare October 14, 2026 21:27
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch 2 times, most recently from 4ada28b to eb6f138 Compare October 14, 2026 22:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from dee3bae to 80f9420 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-base-controller branch from 80f9420 to ebb06ea Compare October 15, 2026 10:36
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from eb6f138 to 5d2a8a8 Compare October 15, 2026 10:36
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from ebb06ea to 98e9897 Compare October 15, 2026 11:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from 5d2a8a8 to 42f3009 Compare October 15, 2026 11:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from 98e9897 to f71e894 Compare October 15, 2026 11:50
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch 2 times, most recently from 3ca6b4f to d648832 Compare October 15, 2026 12:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch 2 times, most recently from 00ff6ed to b438676 Compare October 15, 2026 13:21
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from d648832 to 4a2b96c Compare October 15, 2026 13:21
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-base-controller branch from b438676 to 2c1c3f8 Compare October 15, 2026 14:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from 4a2b96c to 2bbfd60 Compare October 15, 2026 14:48
@cryptodev-2s
cryptodev-2s changed the base branch from test/vitest-base-controller to test/vitest-setup October 15, 2026 14:56
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-polling-controller branch from 2bbfd60 to 6ca0307 Compare October 15, 2026 15:38

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