Repository navigation
chore: migrate src tests from jest to vitest - #312
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning MetaMask internal reviewing guidelines:
Ignoring alerts on:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7cd926b to
078b0d5
Compare
9240aad to
cc9dcf2
Compare
cc9dcf2 to
964a2c2
Compare
964a2c2 to
e978a7f
Compare
e978a7f to
b29d4bf
Compare
ca5a882 to
43c2a2c
Compare
43c2a2c to
9811f8b
Compare
b1d4f5d to
d72d152
Compare
d72d152 to
d786e70
Compare
d786e70 to
241e16e
Compare
241e16e to
45f5193
Compare
45f5193 to
ed17138
Compare
|
@SocketSecurity ignore npm/detect-libc@2.1.2 Both come in through vitest and vite, which we already use in other repos. The libc detection package runs system commands to tell glibc from musl, and tinyexec is the small process spawning helper from tinylibs that vitest uses. |
11cf38b to
99764b6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 99764b6. Configure here.
| "ts-node": "^10.9.1" | ||
| "ts-node": "^10.9.1", | ||
| "vite": "^8.3.6", | ||
| "vitest": "^5.1.0" |
There was a problem hiding this comment.
Depcheck ignores omit Vitest packages
Medium Severity
vite and @vitest/coverage-v8 are added as direct dependencies but never imported, and they are missing from .depcheckrc.json ignores. yarn lint:dependencies runs depcheck, which treats both as unused and fails the lint job.
Reviewed by Cursor Bugbot for commit 99764b6. Configure here.
99764b6 to
130c2f8
Compare
130c2f8 to
6fd8ca2
Compare
6fd8ca2 to
89a5a48
Compare


Swaps jest for vitest in src, and since coverage moves to v8 the lines and statements thresholds were reset slightly.
Note
Low Risk
Test-runner and dependency swap only; production
srcbehavior is unchanged, with coverage thresholds preserved at similar levels.Overview
Replaces Jest with Vitest for all
src/**/*.test.tstests: deletesjest.config.js, addsvitest.config.mts(2500ms timeout, mock reset/restore, coverage via v8 withautoUpdatethresholds slightly retuned from the old babel-based gate), and updatespackage.jsonscripts tovitest run --coverageplusvitest --watchwhile dropping Jest-related devDependencies andjest-it-up.Test files now import
describe/expect/it(andvifor mocks) fromvitestinstead of relying on Jest globals; mock usage is migrated fromjest.fn()tovi.fn().oxlint-suppressions.jsonis pruned for removed Jest config and Jest-era test lint suppressions.Reviewed by Cursor Bugbot for commit 89a5a48. Bugbot is set up for automated code reviews on this repo. Configure here.