Change8

v4.0.16

📦 vitestView on GitHub →
2 features🐛 9 fixes1 deprecations🔧 6 symbols

Summary

Vitest v4.0.16 primarily delivers bug fixes, introduces the experimental `setupEnvironment` export, and deprecates `test.poolOptions`.

Migration Steps

  1. Remove or replace usage of `test.poolOptions` as it is now deprecated; migrate to the new configuration API if needed.
  2. Update imports to use `import { recordArtifact } from "vitest"` instead of previous paths.
  3. Do not call `suite` inside test functions; move suite definitions outside of tests.
  4. Verify that any fully dynamic imports still work as expected after the change.

✨ New Features

  • Export `setupEnvironment` function for custom pools (experimental).
  • Import `recordArtifact` directly from the vitest package.

🐛 Bug Fixes

  • Restore browser mode default testTimeout to 15 seconds.
  • Prevent crashes when `process.versions` is stubbed.
  • Reject calling suite function inside a test.
  • Allow inlining fully dynamic import.
  • Fix module graph UI on HTML reporter when using headless browser mode.
  • Log deprecated `test.poolOptions` if it's set.
  • Browser: Fix `import.meta.env` define handling.
  • Browser: Fix string formatting bug when including placeholders in console.log.
  • Coverage: Disable source maps for Istanbul untested files.

🔧 Affected Symbols

test.poolOptionsrecordArtifactsetupEnvironmentimport.meta.envsuiteprocess.versions

⚡ Deprecations

  • `test.poolOptions` is deprecated; setting it will now log a warning.