NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2782 most downloaded on npm
UI for Vitest
Last release 4 days ago
30 Sep 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
370 releases · first in 2021
One column per quarter.
Vitest now uses v8 code coverage directly for better performance. @vitest/coverage-c8 is deprecated as Vitest no longer uses c8 package for coverage o…
test.js to be a test file. Also any file in __tests__ is now considered to be a test, not just files with test or spec suffix.@vitest/coverage-v8 package - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3339 <samp>(82112)</samp>
@vitest/coverage-c8 is deprecated as Vitest no longer uses c8 package for coverage output. It will not be updated anymore, and Vitest will fail in the next version if the user has c8 as their coverage provider. Please, install the new @vitest/coverage-v8 package if you previously used @vitest/coverage-c8.spy.mockRestore on auto-mocked named exports will no longer restore their implementation to the actual function. This behavior better matches what Jest does.expect.soft - by @Dunqing in https://github.com/vitest-dev/vitest/issues/3507 <samp>(7c687)</samp>describe/test name - by @fenghan34 in https://github.com/vitest-dev/vitest/issues/3497 <samp>(15253)</samp>Enable experimentalOptimizer - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3413 (5a894)
Support VITE_NODE_DEPS_MODULE_DIRECTORIES from .npmrc - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3471 (393bf)
VITE_NODE_DEPS_MODULE_DIRECTORIES from .npmrc - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3471 <samp>(393bf)</samp>Throw error if using inline snapshot inside of test.each or describe.each - by @fenghan34 and @sheremet-va in https://github.com/vitest-dev/vitest/iss
test.each or describe.each - by @fenghan34 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3360 <samp>(7c2f7)</samp>reportOnFailure option - by @AriPerkkio and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3453 <samp>(1988f)</samp>SIGINT is received - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3407 <samp>(a2cc2)</samp>rejects & resolves breaks with thenable objects - by @fenghan34 in https://github.com/vitest-dev/vitest/issues/3456 <samp>(4e996)</samp>birpc timeouts when Math.random mock is not restored - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3460 <samp>(cd5d5)</samp>less extension - by @rluvaton in https://github.com/vitest-dev/vitest/issues/3465 <samp>(4d045)</samp>PartialMock with async TReturns - by @ghry5 in https://github.com/vitest-dev/vitest/issues/3462 <samp>(b664d)</samp>watch: Press r should rerun current pattern tests - by @Dunqing and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3305 (69d27)
r should rerun current pattern tests - by @Dunqing and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3305 <samp>(69d27)</samp>cwd from test name filter - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3353 <samp>(324a9)</samp>toMatchInlineSnapshot fails when file path includes parentheses - by @pacexy in https://github.com/vitest-dev/vitest/issues/3370 and https://github.com/vitest-dev/vitest/issues/3371 <samp>(dcf13)</samp>Remove browser from allowed pools inside poolMatchGlob config option. Please, use Vitest workspaces for running tests in the browser.
Remove browser from allowed pools inside poolMatchGlob config option. Please, use Vitest workspaces for running tests in the browser.
Move assertion declarations to expect package - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3294 <samp>(cf3af)</samp>
- declare namespace Vi {
+ declare module 'vitest' {
interface Assertion<T = any> extends CustomMatchers<T> {}
interface AsymmetricMatchersContaining extends CustomMatchers {}
}
vi.hoisted to run code before imports are executed:vi.hoisted(() => vi.setSystemTime(new Date(2022, 1, 1)))
You can also use it to pass variables to vi.mock:const { mockedMethod } = vi.hoisted(() => {
return { mockedMethod: vi.fn() }
})
vi.mock('./path/to/module.js', () => {
return { originalMethod: mockedMethod }
})
--bail option for cancelling test run - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3163 <samp>(8d460)</samp>thresholdAutoUpdate to work with perFile - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3182 <samp>(29eeb)</samp>import.meta.hot.send mock - by @antfu <samp>(b1624)</samp>Do not rely on global performance and AggregateError - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3171 (cce45)
performance and AggregateError - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3171 <samp>(cce45)</samp>test.each respects chaiConfig - by @sheremet-va <samp>(4f6c1)</samp>toMatchFileSnapshot ensure dir exists - by @antfu in https://github.com/vitest-dev/vitest/issues/3155 <samp>(31168)</samp>skipWriting check - by @antfu <samp>(5436c)</samp>toMatchFileSnapshot - by @antfu in https://github.com/vitest-dev/vitest/issues/3164 <samp>(df3f2)</samp>Remove tinyspy internal properties on Vitest spies - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3069 (2f1dc)
toMatchFileSnapshot and auto queuing expect promise - by @antfu in https://github.com/vitest-dev/vitest/issues/3116 <samp>(bdc06)</samp>Allow accessing "vi" methods without context, don't fail when mocker is not available - by @sheremet-va in https://github.com/vitest-dev/vitest/issues
istanbul coverage support for browser testing - by @sheremet-va and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3040 <samp>(0f44d)</samp>Import @vite/client in browser code for handling optimizer - by @sheremet-va (20c51)
Bundle UI with @vitest/browser - by @sheremet-va (14091)
browser: Relax vitest peer dependency - by @cexbrayat in https://github.com/vitest-dev/vitest/issues/3039 (865d1)
--test-timeout CLI argument - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3019 (63c62)
--test-timeout CLI argument - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3019 <samp>(63c62)</samp>Use custom colors implementation instead of picocolors - by @sheremet-va (427b0)
any as default value for TArgs in vi.fn() - by @jessevanassen in https://github.com/vitest-dev/vitest/issues/2947 <samp>(1bdcc)</samp>Optimize dependencies in setup files - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2935 (c169f)
Wait for optimized dependency to be bundled in non-pnpm package managers - by @sheremet-va (d2460)
One of the breaking changes includes adding a link to snapshots inside snapshot files, meaning you will need to update all your snapshots.
This release makes some significant changes to how tests are running. If you were using --no-threads before, you might consider enabling --single-thread instead (because your tests are now running in child_process instead of a worker thread) or try our new performance optimization feature (discussed later). If you were relying on API that was not available inside a worker (like process.chdir(), you can now use this option.
One of the potential breaking bug fixes is that environments do not share the same global scope anymore if you run them with --no-isolate, --no-threads or --single-thread - you might need to update your setup files if you were relying on a global variable before.
If you had performance issues on large code bases before, try the new deps.experimentalOptimizer option instead of disabling threads. Feedback is welcome!
One of the breaking changes includes adding a link to snapshots inside snapshot files, meaning you will need to update all your snapshots.
NODE_V8_COVERAGE - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2786 <samp>(095c6)</samp>node and jsdom (and other environments) now don't share the same global scope, if you run them with --no-isolate or --no-threads flag. Vitest doesn't provide a way to restore the previous behavior as it is considered a bug.chid_process might run longer due to the communication overhead. If you want to restore the previous behavior, use --single-thread.Add --script option to vite-node - by @jgoux and @dammy001 in https://github.com/vitest-dev/vitest/issues/2793 (d3d6b)
Setup correct utils inside asymmetric matchers - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2768 (415c8)
onWatcherStart when typecheck.ignoreSourceErrors is true - by @mascii and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2774 <samp>(d612e)</samp>Allow using atomics to communicate between threads - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2758 (3679c)
config option to be false - by @antfu in https://github.com/vitest-dev/vitest/issues/2749 <samp>(c66e3)</samp>Send stderr header log to stderr - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2736 (998ea)
timestamp: 0 - by @danielroe in https://github.com/vitest-dev/vitest/issues/2747 <samp>(e88c0)</samp>Remove UI from Vitest dependencies - by @sheremet-va (b120c)
Don't rely on environment for interopDefault - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2682 (3f20c)
@vitet/runner package instead of vitestThrow unhandled exception, if code throws "error" event - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2691 (6a30c)
environmentMatchGlobs option to auto infer env based on glob - by @antfu in https://github.com/vitest-dev/vitest/issues/2714 <samp>(3e142)</samp>reportCoverage context can be optional - by @antfu <samp>(4cd1e)</samp>Add runAllTimersAsync from sinonjs - by @guillaumeduboc in https://github.com/vitest-dev/vitest/issues/2209 (40187)
coverage.all only when all tests are run - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2665 <samp>(85096)</samp>Show error, when process.exit is called - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2643 (866f4)
coverage.extension - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2641 <samp>(7e388)</samp>Deprecate "error" on result, store errors in "errors" - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2586 (e641a)
mock: Expose a importOriginal helper to the factory - by @antfu in https://github.com/vitest-dev/vitest/issues/2551 (853ee)
importOriginal helper to the factory - by @antfu in https://github.com/vitest-dev/vitest/issues/2551 <samp>(853ee)</samp>Project name - by @antfu (84f98)
dir - by @antfu in https://github.com/vitest-dev/vitest/issues/2550 <samp>(f6b59)</samp>Add more options to configure diff output - by @sheremet-va and @dammy001 in https://github.com/vitest-dev/vitest/issues/2522 (7ae14)
vite-node: Rewrite how vite-node resolves id - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2463 (58ee8)
node, Vitest will not resolve invalid named exports (exports that are on "default" property will not magically appear as named exports), unless deps.interopDefault is enabled, or dependency is in deps.inline. This change doesn't affect jsdom, happy-dom or edge environments.structuredClone, if it's available, or fallbacks to a polyfill.SharedWorker@vitest/ui installed, you can now use 'html' reporter to get a beautiful UI to view your test results, inspect module graph and read log messages.Add mts, cts files to coverage - by @poyoho and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2492 (799f9)
Support Vite 4 - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2470 (3bb6b)
Expected reversed with actual - by @poyoho in https://github.com/vitest-dev/vitest/issues/2460 (f02c9)
ui: Show diff in report panel - by @scarf005 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2406 and https://github.com/vitest-dev/vi
Slow test threshold - by @poyoho and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2396 (98974)
each title - by @scarf005 in https://github.com/vitest-dev/vitest/issues/2420 and https://github.com/vitest-dev/vitest/issues/2421 <samp>(1868f)</samp>Test.each support string template - by @poyoho in https://github.com/vitest-dev/vitest/issues/2337 (f7897)
. - by @sidharthv96 in https://github.com/vitest-dev/vitest/issues/2344 and https://github.com/vitest-dev/vitest/issues/2359 <samp>(c3951)</samp>Dates are equal, if both are invalid - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2326
Add vi.setConfig helper - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2293
vi.setConfig helper - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2293bench when using options - by @poyoho in https://github.com/vitest-dev/vitest/issues/2295In 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
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
startVitest() - by @antfu in https://github.com/vitest-dev/vitest/issues/2072onTestFailed hook - by @antfu in https://github.com/vitest-dev/vitest/issues/2210.each behavior with jest - by @bartoszgolebiowski and @antfu in https://github.com/vitest-dev/vitest/issues/2064vite-node: Trigger beforeFullReload / beforePrune / invalidate hook - by @ycmjason in https://github.com/vitest-dev/vitest/issues/2079
vite-node: Don't exit on uncaughtException in watch mode - by @poyoho in https://github.com/vitest-dev/vitest/issues/2186
repository properties in package.json - by @silverwind in https://github.com/vitest-dev/vitest/issues/2151executeFile - by @poyoho in https://github.com/vitest-dev/vitest/issues/2184build: Build packages before publishing - by @sheremet-va (3c4a2)
ui: Add tests summary in the dashboard - by @webfansplz and @userquin in https://github.com/vitest-dev/vitest/issues/2133
Remove work-around from istanbul-lib-instrument - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2121
istanbul-lib-instrument - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2121Use type module (revert #1411) - by @bluwy and @sheremet-va in https://github.com/vitest-dev/vitest/issues/1465
Give helpful message, when using vi.mock - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2047
istanbul-reports to support projectRoot - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2051Added fastify example - by @irvile in https://github.com/vitest-dev/vitest/issues/1991
Show diff for errors that contain actual/expected without showDiff - by @IgnusG in https://github.com/vitest-dev/vitest/issues/1966
Don't reset modules with --no-isolate - by @sheremet-va and @poyoho in https://github.com/vitest-dev/vitest/issues/1754
retry option for tests - by @antfu in https://github.com/vitest-dev/vitest/issues/1929vitest bench command - by @poyoho in https://github.com/vitest-dev/vitest/issues/1029Restart vitest on config change - by @antfu (c663f)
moduleCache.invalidateDepTree utiltity - by @antfu in https://github.com/vitest-dev/vitest/issues/1872c8 coverage support now require peer dependency @vitest/coverage-c8 to be installed. Alternatively, you can install @vitest/coverage-istanbul to use i
c8 coverage support now require peer dependency @vitest/coverage-c8 to be installed. Alternatively, you can install @vitest/coverage-istanbul to use istanbul for coverage instead of c8.--segfault-retry - by @tony19 @antfu in https://github.com/vitest-dev/vitest/issues/1854istanbul coverage provider - by @AriPerkkio and @antfu in https://github.com/vitest-dev/vitest/issues/1676--inspect and --inspect-brk - by @antfu <samp>(ea80f)</samp>types: Better local test context support - by @Tanimodori in https://github.com/vitest-dev/vitest/issues/1805
Show stack trace for aggregated errors, show full stack trace - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1777
Show start time in test summary - by @mikekidder, @sheremet-va and @antfu in https://github.com/vitest-dev/vitest/issues/1734
Add deps.registerNodeLoader option - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1751
Bundle suppress-warnings - by @sheremet-va (bd567)
Apply Vite resolving algorithm to node_modules libraries - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1673
clover reporter by default - by @antfu <samp>(5862e)</samp>Add mock snapshot serializer - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1717
Add CSS styles to DOM - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1690
Your coding agent can read these notes before it upgrades. Set up the MCP server →