yarn vitest 0.29.0
v0.29.0

latest releases: 2.2.0-beta.1, 2.1.5, 2.1.4...
20 months ago

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.

   🚨 Breaking Changes

  • Vitest as peer dependency for coverage packages  -  by @AriPerkkio in #2836 (94247)
  • Coverage-c8 to use V8 profiler directly instead of NODE_V8_COVERAGE  -  by @AriPerkkio in #2786 (095c6)
  • Add a link to the comment at the top of the snapshot file  -  by @btea in #2867 (615e1)
  • Always run separate environments in isolation  -  by @sheremet-va in #2860 (1f858)
    • Tests with 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.
  • Use child_process when --no-threads is used  -  by @sheremet-va in #2772 (7bf54)
    • Tests inside chid_process might run longer due to the communication overhead. If you want to restore the previous behavior, use --single-thread.

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

Don't miss a new vitest release

NewReleases is sending notifications on new releases.