Vitest v4.1.1 Update: New Features & Stability Fixes

Vitest, a fast unit test framework, has released version 4.1.1 on 2026-03-23, focusing on experimental features and crucial bug fixes to enhance stability and developer experience. This update is significant for teams utilizing modern JavaScript testing practices. For those comparing different testing frameworks, our article on Jest vs. Mocha comparison offers further insights.

Key Changes

Experimental Features: Vitest v4.1.1 introduces two experimental features:

  • matchesTags: This new utility allows testing if the current filter matches specific tags, offering more granular control over test execution.
  • experimental.vcsProvider: A new configuration option to integrate with Version Control Systems, potentially streamlining test workflows based on code changes.

Bug Fixes: This patch release resolves several issues across various modules:

  • Assertions & Mocks: Fixes include a type regression in vi.mocked() static class methods and ensuring soft assertions continue correctly after .resolves/.rejects promise errors in expect. The sinon-chai style API also received a fix.
  • Coverage & Reporting: Issues with preserving coverage reports when HTML reporters overlap have been resolved, alongside improvements in loading built-in coverage providers.
  • Test Runner Stability: The update addresses problems like detecting fixtures that return without calling use, preventing event listener leaks in the Playwright provider, and providing vi.advanceTimers to the preview provider.
  • Vite Compatibility: Vitest v4.1.1 drops support for Vite 8.beta, ensuring compatibility with stable Vite versions.
  • Output Clarity: pretty-format now limits output for large objects, improving readability of test results.

Impact for QA Teams

QA engineers will find Vitest v4.1.1 improves the reliability of their test suites and debugging processes. The fixes in expect and vi.mocked() enhance the accuracy of unit tests, while coverage reporting improvements provide more dependable metrics. Experimental features like matchesTags offer future possibilities for advanced test selection strategies.

FAQ

Q: What are the main new features in Vitest v4.1.1? A: The update introduces experimental matchesTags for advanced test filtering and experimental.vcsProvider for VCS integration.

Q: Are there any breaking changes in this update? A: Vitest v4.1.1 drops support for Vite 8.beta. Users on stable Vite versions should not experience breaking changes.

Q: Why should QA engineers consider updating to Vitest v4.1.1? A: This update brings crucial bug fixes that improve test stability, assertion reliability, and coverage reporting, leading to more trustworthy test results and a better debugging experience.

View changes on GitHub