Skip to content

test: run phishing-controller on Vitest - #10554

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

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

Conversation

@cryptodev-2s

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

Copy link
Copy Markdown
Contributor

Explanation

Moves @metamask/phishing-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-only migration with no runtime or API changes; risk is limited to CI/local test behavior if Vitest config diverges from the old Jest setup.

Overview
Migrates @metamask/phishing-controller from Jest to Vitest with no production code changes.

The package drops jest.config.cjs and Jest-related devDependencies, adds vitest.config.mjs (same coverage thresholds as before), and switches test / test:watch scripts to Vitest. tsconfig.json sets compilerOptions.types to [] so repo-wide Jest types do not apply under Vitest without globals.

All *.test.ts files are updated to import from vitest and use vi.* instead of jest.* (mocks, spies, fake timers, importActual). @metamask/phishing-controller is removed from the Jest allowlist in test-runner-package-map.cjs, and oxlint-suppressions.json is adjusted for the new setup.

Reviewed by Cursor Bugbot for commit 0fb9fa5. 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:19
@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-phishing-controller branch from b64be55 to 8721c5d Compare September 29, 2026 08:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch from b92fe81 to 175e025 Compare September 29, 2026 08:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch from 8721c5d to 8b414fc Compare September 29, 2026 09:02
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch 2 times, most recently from 186a8bd to 69b48d1 Compare September 29, 2026 14:38
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch from 8b414fc to 807c7f5 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-controller-utils branch from 69b48d1 to 289154f Compare September 30, 2026 07:04
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch 2 times, most recently from 356fffc to 6027196 Compare October 5, 2026 10:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch from 289154f to 3cec491 Compare October 5, 2026 10:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch from 3cec491 to eb6905d Compare October 12, 2026 14:02
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch 2 times, most recently from 77482d5 to 72c543c Compare October 12, 2026 15:43
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch 2 times, most recently from 425f889 to b5450af Compare October 14, 2026 09:24
@cryptodev-2s
cryptodev-2s requested review from a team as code owners October 14, 2026 09:24
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch from 72c543c to 041de24 Compare October 14, 2026 09:24
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch from b5450af to e837efa Compare October 14, 2026 12:47
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch 2 times, most recently from 464132b to f67889e Compare October 14, 2026 12:53
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch from d77b580 to 6224c52 Compare October 14, 2026 13:44
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch from 1f1d11f to d6ffd65 Compare October 14, 2026 18:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch from 0bec1e3 to aecebdc Compare October 14, 2026 18:11
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch from d6ffd65 to d5ff385 Compare October 14, 2026 20:18
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch from aecebdc to 3b9f474 Compare October 14, 2026 20:18
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch from d5ff385 to 8ebcdfa Compare October 14, 2026 20:37
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch 2 times, most recently from 265b5e5 to ac1e48d Compare October 14, 2026 20:59
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch 2 times, most recently from 910c9b2 to 10f6716 Compare October 14, 2026 21:27
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch 2 times, most recently from 5e8aeea to ef5f527 Compare October 14, 2026 22:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch from 10f6716 to f7ae283 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-controller-utils branch from ef5f527 to 86786bb Compare October 15, 2026 10:36
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch 2 times, most recently from 53d230f to 8fd33d9 Compare October 15, 2026 11:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch from 86786bb to 25334b8 Compare October 15, 2026 11:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch from 8fd33d9 to c27cc50 Compare October 15, 2026 11:50
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch 2 times, most recently from 3126f77 to f31c96c Compare October 15, 2026 12:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch from c27cc50 to b2ad15e Compare October 15, 2026 12:20
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch from f31c96c to e5aee1b Compare October 15, 2026 13:21
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch 2 times, most recently from 845a892 to f260b1e Compare October 15, 2026 14:48
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-controller-utils branch from e5aee1b to db2b678 Compare October 15, 2026 14:48
@cryptodev-2s
cryptodev-2s changed the base branch from test/vitest-controller-utils to test/vitest-setup October 15, 2026 14:56
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch 2 times, most recently from 125948f to 215c496 Compare October 15, 2026 20:07
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-phishing-controller branch from 215c496 to 0fb9fa5 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