npm @vitest/coverage-v8 2.0.0
v2.0.0

latest releases: 2.1.1, 2.1.0, 2.1.0-beta.7...
2 months ago

Vitest 2.0 is here! This release page lists all changes made to the project during the beta. For the migration guide, please refer to the documentation.

🚨 Breaking Changes

  • Simplify mock function generic types and align with jest - by @hi-ogawa in #4784 (a0c1d37)
  • Remove --segfault-retry - by @sheremet-va in #5514 (ed60e)
    • This flag was introduced to combat threads segfaults. Our current recommendation is to use the new default forks pool instead.
  • Run suite hooks in a stack - by @sheremet-va in #5609 (1277d)
    • This feels like a more sensible default. Especially with the new onTestFinished hook. This can make your tests run a little bit slower.
  • Enable coverage.ignoreEmptyLines by default - by @AriPerkkio in #5543 (31994)
    • ⚠️ This change may cause significant differences in your coverage results compared to Vitest v1. These changes are expected as coverage reporting is now more accurate. See #5423 for more details.
  • Add correct location and snapshot fields in json reporter - by @sheremet-va in #5434 (bcccc)
    • Previously, the location field pointed to the error location instead of the test location. Now it is aligned with jest and contains the line and column of a test function, but requires includeTaskLocation to be enabled.
  • Update dependency chai to v5 - by renovate[bot] and @sheremet-va in #5135 (73646)
  • Remove watchExclude - by @patak-dev in #5177 (d7371)
  • Change default pool to 'forks' - by @AriPerkkio in #5047 (7f8f9)
  • --merge-reports to support coverage - by @AriPerkkio in #5736 (b7438)
  • Add promise-based return assertions, do not auto-resolve returned promises - by @sheremet-va in #5749 (5f710)
    • ⚠️ Vitest no longer unwraps promises in spy.mock.returns. If the function is async or returns a promise, it will always succeed and have a Promise in results. To make migration easier, we introduced spy.mock.settledResults that unwraps promises and expect().toHaveResolved() matcher that accepts unwrapped value.
  • Do not exit process if global setup has failed - by @sheremet-va in #5726 (ddb09)
  • Don't exit process if config failed - by @sheremet-va in #5715 (f232f)
  • Add meta to json output - by @sheremet-va in #5802 (dd754)
  • Rename indexScripts to orchestratorScripts in the browser config - by @sheremet-va in #5842 (49f34)
  • Add "vitest list" API to print collected tests without running them - by @sheremet-va in #6013 (583dd)
    • ⚠️ This changes the custom pool API - now requires collectTests method alongside runTests.
  • Remove the empty suite from the runner - by @sheremet-va in #5435 (dbbbe)
  • Support concurrent suites - by @hi-ogawa in #5491 (222ce44)

🚀 Features

🐞 Bug Fixes

View changes on GitHub

Don't miss a new coverage-v8 release

NewReleases is sending notifications on new releases.