vitest
5.1.1 · 18 Nov 2026MIT193.3M / weekRepositoryHomepagenpmAtom feed
0.34.6 is the newest release of 0.25.x.
In short
1 breaking1 removed4 new6 fixed
- Breaking
Return context in
startVitest() - Removed
Remove undefined values in options
Security
1 advisory affects 0.25.0; 3.2.6 fixes them
- CriticalWhen Vitest UI server is listening, arbitrary file can be read and executedGHSA-5xrq-8626-4rwp · 1 Jun 2026Fixed in 3.2.6
Release note
Builtin TypeChecking
In v0.25.0, Vitest allows you to write tests for your types, using expectTypeOf or assertType syntaxes. By default all tests inside *.test-d.ts files are considered type tests. Run vitest typecheck to run type tests.
// my.test-d.ts
import { assertType, expectTypeOf } from 'vitest'
import { mount } from './mount.js'
test('my types work properly', () => {
expectTypeOf(mount).toBeFunction()
expectTypeOf(mount).parameter(0).toMatchTypeOf<{ name: string }>()
// @ts-expect-error name is a string
assertType(mount({ name: 42 }))
})Learn more at the documentation and this RFC
Breaking Changes
- Breaking
Return context in
startVitest()
Features
onTestFailedhookDisplay error frame if present (like Vite)
Benchmark table report
Add typechecking functionality
Bug Fixes
Clear full screen only in watch mode
Don't serialize symbols and immutables
Use --conditions instead of -C
Show correct stack trace in errors and console
Align
.eachbehavior with jest- Removed
Remove undefined values in options
coverage: Istanbul provider to preserve implicit else
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.