Skip to content

test: run utils on Vitest - #10871

Open
cryptodev-2s wants to merge 2 commits into
mainfrom
test/vitest-utils
Open

cryptodev-2s wants to merge 2 commits into
mainfrom
test/vitest-utils

Conversation

@cryptodev-2s

@cryptodev-2s cryptodev-2s commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

Moves @metamask/utils to Vitest.

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 tooling changes; no production runtime code in @metamask/utils is altered.

Overview
Migrates @metamask/utils from Jest + tstyche to Vitest for unit tests and built-in typecheck, consolidating test scripts and dropping Jest/tstyche config and dependencies.

Adds vitest.config.js (100% coverage thresholds, typecheck on) and removes jest.config.cjs. Test files switch to vi/vitest imports; mocks and spies are updated where Jest patterns do not carry over (@noble/hashes spy mocks, jest-when → explicit spy + toHaveBeenCalledWith, vi.stubGlobal for Error, proxy trap for isPlainObject, it.each %# for non-serializable fixtures). Former *.tst.ts type tests become *.test-d.ts using expectTypeOf (as const where literals matter).

Package tsconfig.json gains skipLibCheck so Vitest typecheck tolerates web3 declarations under exactOptionalPropertyTypes. @metamask/utils is removed from the repo Jest test-runner map; oxlint suppression entries are trimmed/renamed for the new file names.

Reviewed by Cursor Bugbot for commit 4e5140a. 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 October 16, 2026 17:41
@cryptodev-2s
cryptodev-2s deployed to default-branch October 16, 2026 17:41 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
default-branch — 4e5140ac Deployed Oct 16, 2026 by cryptodev-2s via Determine whether this PR is a release PR #5616
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