What changed in Vitest from 4 to 5

1 release numbered after v4.1.11 up to and including v5.0.0, stable releases only. v4.1.11 and v5.0.0 are the newest stable releases of 4 and 5 we track; this page follows them as new ones ship.

20 changes across 1 release

Added 1

v5.0.0

  • Add screenshotDirectory config to browser.expect.toMatchScreenshot
Changed 15

v5.0.0

  • Replace loupe.inspect with pretty-format
  • Remove quotes from string values in test.for/each title $ variable
  • Change default attachmentsDir from .vitest-attachements/ to .vitest/attachments/
  • Represent locator as an object instead of a string
  • Inline expect package
  • Require Node.js 22 and Vite 6.4
  • Fail expect.poll when function didn't resolve in time
  • Throw an error if hoistable methods are outside the top level scope
  • Make toHaveTextContent strict and add toMatchTextContent as alternative
  • Don't lookup config file from ancestor directories
  • Allow mutating happy-dom/jsdom window object
  • Expose concurrencyId/workerId on TestModule's diagnostics and make id 1-based
  • Update @sinonjs/fake-timers and support mocking Temporal
  • Clear mocks by default before each test
  • Support nested projects
Removed 4

v5.0.0

  • Remove sequential test/suite options in favor of concurrent
  • Remove deprecated entry points
  • Inline @vitest/runner package and do not publish it anymore
  • Remove webdriverio package

Original release notes, newest first

The list above is our reading of these notes; the originals from VoidZero are here, one fold per release.

v5.0.0

Vitest 5 is officially out! This release focuses on performance and brings a lot of new features while fixing long-standing bugs. See our blog post for the official announcement.

   🚨 Breaking Changes
   🚀 Features
   🐞 Bug Fixes
   🏎 Performance
    View changes on GitHub

View originalPermalink