Packages

vitest

5.1.1 · 18 Nov 2026MIT193.3M / weekRepositoryHomepagenpmAtom feed

Your version

0.25.0

7 Nov 2022Where it was published

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

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

  • onTestFailed hook

  • Display 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 .each behavior 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.