feat(test): switch wasm integration tests to vitest - #1302
Conversation
🔍 SDK Breaking Change DetectionSDK Version:
Breaking change detection uses the build of the SDK from this branch, including any incompatibities pre-existing on or merged into this branch. Check the workflow logs to confirm. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1302 +/- ##
=======================================
Coverage 85.81% 85.81%
=======================================
Files 490 490
Lines 70590 70590
=======================================
Hits 60574 60574
Misses 10016 10016 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the migration of the WASM integration test suite from Jest/ts-jest to Vitest: removal of Code Review Details
Dependency Changes
|
| "types": ["jest", "node"] | ||
| "types": ["vitest/globals", "node"] | ||
| }, | ||
| "include": ["*.ts"] |
There was a problem hiding this comment.
♻️ DEBT: Test files are no longer type-checked, and the new vitest/globals types don't reach them.
Details and fix
Two related gaps:
include: ["*.ts"]only matches top-level files, sotests/**/*.test.tsare outside this project. The"types": ["vitest/globals", ...]change therefore does not apply to the test files themselves (editors fall back to an inferred project, wheredescribe/it/expectare untyped).ts-jestreported TypeScript diagnostics as test failures by default, sonpm testused to type-check the suite. Vitest transpiles via esbuild without type checking, so a type error in a test file (e.g. an FFI signature that changed shape) now passes CI silently — which is precisely what this suite exists to catch.
"include": ["*.ts", "tests/**/*.ts"]plus a script wired into CI (or into test):
"scripts": {
"test": "vitest run",
"typecheck": "tsc --noEmit"
}| "ts-jest": "^29.1.0", | ||
| "typescript": "^5.6.0" | ||
| "typescript": "^5.6.0", | ||
| "vitest": "^3.2.0" |
There was a problem hiding this comment.
vitest is net-new to this repo and no AppSec approval signal is referenced.
Details
vitest (plus its vite/rollup/esbuild transitive tree) does not appear in any other manifest in this repository, so this is a new dependency rather than a version bump. Bitwarden's process applies to all new dependencies, including dev and test tooling.
The PR description covers the justification and what it replaces, but does not reference a VULN task or AppSec sign-off. Please reach out to AppSec to initiate the Dependency Review and Approval process (or link the existing approval if one was already obtained).
Switches our wasm integration tests from jest to vitest. Vitest is more modern and way faster, at basically no maintenance cost.