Change8

Vitest

Dev Tools

Next generation testing framework powered by Vite.

Latest: v4.1.1125 releases8 breaking changes5 common errorsView on GitHub

Release History

View all versions →
v4.1.114 fixes
Aug 18, 2026

This release focuses on bug fixes, including restoring the global concurrency limit and improving browser testing stability by correctly encoding iframe IDs and managing garbage collection. It also enhances the mocker by restricting redirect mocks.

v5.0.0-rc.219 fixes1 feature
Aug 17, 2026

This release introduces custom GitHub Actions summary titles and includes numerous bug fixes across various modules like browser, mocker, pool, and UI. It also updates non-major dependencies and improves error handling and reporting.

v5.0.0-rc.1Breaking18 fixes3 features
Aug 11, 2026

Vitest v1.5 introduces significant changes to project configuration, asynchronous assertion handling, and browser mode capabilities. It also includes numerous bug fixes and performance improvements.

v5.0.0-beta.7Breaking13 fixes4 features
Jul 24, 2026

This release introduces a new pluggable benchmark provider API and enhances performance by optimizing module serving and caching. It also includes several bug fixes across core functionalities and browser testing.

v5.0.0-beta.6Breaking12 fixes1 feature
Jul 6, 2026

This release introduces `vi.when()` and updates underlying dependencies like fake-timers, while enforcing stricter defaults for mock clearing and reporter output locations, leading to several breaking changes.

v4.1.102 fixes
Jul 6, 2026

This patch release primarily focuses on backporting bug fixes related to file system access in browser commands and module resolution in the VM context to the v4 branch.

v3.2.71 fix
Jul 6, 2026

This release primarily contains a bug fix related to file system access checks within builtin commands in the browser environment.

v4.1.95 fixes
Jun 16, 2026

This patch release for v4.1.x focuses on backporting several bug fixes related to imports, browser testing readiness, mocking, and worker stability.

v5.0.0-beta.5Breaking10 fixes3 features
Jun 15, 2026

This release introduces several breaking changes, including changes to configuration lookup and diagnostic IDs, alongside new features like the `--repeats` CLI option and UI improvements for browser testing. Numerous bug fixes address issues across browser, coverage, and mocking functionality.

v3.2.61 fix
Jun 1, 2026

This patch release addresses a bug by pinning the last supported version of vite-node.

v5.0.0-beta.4Breaking10 fixes2 features
Jun 1, 2026

This release introduces new features like trace view steps in the browser and HTML reporter single file output, alongside several breaking changes affecting hoistable methods and assertion strictness. Numerous bug fixes address issues across browser, UI, and mocking functionalities.

v3.2.51 fix1 feature
Jun 1, 2026

This release introduces new `allowWrite` and `allowExec` options for the API configuration and fixes an issue where the client CDP API was not disabled correctly when these options were set to false.

v4.1.82 fixes
Jun 1, 2026

This patch release for v4.1.x focuses on fixing critical bugs in the browser environment related to CDP API access and Playwright route handling.

v4.1.71 fix
May 20, 2026

This release primarily focuses on a bug fix related to concurrency limiting within the test runner.

v5.0.0-beta.3Breaking19 fixes6 features
May 19, 2026

This release introduces support for TypeScript build mode and enhances browser testing capabilities with better tracing and error reporting. It also enforces stricter requirements for Node.js and Vite versions.

v4.1.62 fixes
May 11, 2026

This release focuses on bug fixes, particularly around browser testing and test sequencing, while also deprecating the legacy `sequential` test API.

v5.0.0-beta.2Breaking9 fixes6 features
May 5, 2026

This release introduces significant breaking changes, including updating default attachment directories and replacing the `sequential` option with `concurrent`. New features focus on reporter enhancements and improved coverage tracking.

v5.0.0-beta.1Breaking1 fix3 features
Apr 23, 2026

This release introduces new reporting features and browser snapshot improvements, alongside several breaking changes related to inspection utilities and assertion behavior.

v4.1.511 fixes1 feature
Apr 21, 2026

This release introduces experimental support for the Istanbul instrumenter option and resolves several bugs related to reporters, assertions, snapshot output, and web worker messaging.

v4.1.44 fixes4 features
Apr 9, 2026

This release introduces several experimental features, including changes to coverage reporting and JSON reporter options, alongside fixes for terminal output contrast and import hoisting behavior.

v4.1.310 fixes4 features
Apr 7, 2026

This release introduces several experimental features, including a `preParse` flag and support for custom snapshot matchers. Numerous bug fixes address issues related to fake timers, snapshot reporting, and module resolution.

v4.1.26 fixes
Mar 26, 2026

This release updates the internal flatted dependency to address CVE issues and includes several bug fixes across setup, browser testing, coverage, and formatting.

v4.1.116 fixes3 features
Mar 23, 2026

This patch introduces experimental features like `matchesTags` and `experimental.vcsProvider`, alongside numerous bug fixes across mocking, coverage, assertions, and formatting.

v4.1.036 features
Mar 12, 2026

Vitest 4.1 introduces numerous features including chai style assertions, support for tags, new browser APIs, and updates to underlying dependencies like sinon/fake-timers v15. This version also stabilizes experimental features and improves compatibility with Vite 8 beta.

v4.1.0-beta.69 fixes2 features
Mar 5, 2026

This release introduces new tracing and reporting features, alongside numerous bug fixes addressing issues in jsdom, module loading, fixtures, and reporter behavior.

Common Errors

UserInputElementTypeError2 reports

The "UserInputElementTypeError" in Vitest often arises from missing or improperly configured environment dependencies, especially when using DOM-specific matchers. To resolve this, install `jsdom` using `npm install -D jsdom` and configure Vitest to use it as the environment in your `vitest.config.ts` file by adding `environment: 'jsdom'`. If already present, ensure versions of jsdom and related dependencies like `@testing-library/jest-dom` are compatible and up-to-date.

GenericTypeError2 reports

GenericTypeError in Vitest often arises from missing or mismatched dependencies, particularly Chai matchers. Ensure all necessary dependencies, including `@testing-library/jest-dom` or similar Chai plugins, are correctly installed and configured in your `vitest.config.ts` file, using `setupFiles` to import the required matchers. Verify that package versions are compatible and that any custom matchers are correctly defined and registered.

SyntaxError1 report

A "SyntaxError" in vitest often arises from invalid JavaScript syntax within your test files or imported modules, such as an improperly formatted regular expression or incorrect use of ES modules features. To fix this, carefully examine the reported file and line number in the error message, correct the syntax error (e.g., escaping special characters in regex, ensuring correct import/export statements), and rerun vitest. Consider using a linter or IDE with syntax checking to catch these errors earlier.

TypeCheckError1 report

TypeCheckError in Vitest often stems from incorrect or missing TypeScript configurations, preventing Vitest from properly understanding and processing your code's types. Ensure your `tsconfig.json` is correctly configured, includes necessary files, and that all required type definitions are installed by running `npm install` or `yarn install` to resolve missing dependencies before running Vitest. Review your `vite.config.ts` or `vitest.config.ts` to confirm the tsconfig path is correctly specified.

VitestBrowserElementError1 report

The "VitestBrowserElementError" usually arises when Vitest's browser environment struggles to locate a specific DOM element, often due to asynchronous rendering in components or elements being rendered outside the current test's scope (like modals). Wrap the code causing the rendering or element access with `await nextTick()` (or `await vi.advanceTimersByTime()`) to allow asynchronous updates to complete before querying the DOM. Alternatively, ensure elements rendered outside the tested component (e.g., modals within a portal) are correctly mocked or rendered within the test environment using tools like `@testing-library/react`'s `render` with a container option targeting a DOM element within the test.

Related Dev Tools Packages

Subscribe to Updates

Get notified when new versions are released

RSS Feed