Vitest v0.31.0stable Released May 03, 2023
โš ๏ธ Breaking Change Impact Score: 7/10

Vitest v0.31.0 โ€” Release Notes & Engineering Impact

Source available โ€” automated, not human-reviewed

Component: vitest ยท Channel: stable. Automated analysis, not a compatibility certification. How this works.

Analysis updated: 2026-11-01.

Breaking-change evidence from the source

  •    ๐Ÿšจ Breaking Changes - Remove `browser` from allowed pools inside `poolMatchGlob` config option. Please, use Vitest workspaces for running tests in the browser.
Read the original context โ†—
Source flags breaking changes โ€” review applicability
๐Ÿ“„ .MD
โšก Executive Summary (TL;DR)

Vitest v0.31.0. Source highlight:    ๐Ÿšจ Breaking Changes

Who Does This Impact? (Role-Based Analysis)

๐Ÿ’ป Software Engineers & Devs

Check the source notes against the package and APIs you use before upgrading.

๐Ÿ“Š Product & Engineering Leads

Use the documented changes to assess relevance to your product; release frequency alone is not a quality measure.

โš™๏ธ DevOps & Security

Verify the target version, runtime requirements and rollback procedure in the official documentation.

โš ๏ธ Breaking Changes & Deprecations (1)

  •    ๐Ÿšจ Breaking Changes - Remove `browser` from allowed pools inside `poolMatchGlob` config option. Please, use Vitest workspaces for running tests in the browser.

โœจ New Features & Capabilities (6)

  • Update mock implementation to support ESM runtime, introduce "vi.hoisted" &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3258 <samp>(0c09a)</samp>
  • Bypass ESM import order restriction with `vi.hoisted` to run code before imports are executed:
  • Add repeat method to tests &nbsp;-&nbsp; by @samkevin1 in https://github.com/vitest-dev/vitest/issues/2652 <samp>(7c8f0)</samp>
  • Add an option to hide skipped test lines &nbsp;-&nbsp; by @g4rry420 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2745 <samp>(9bdb1)</samp>
  • **coverage**: Watermarks for c8 &nbsp;-&nbsp; by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3254 <samp>(730af)</samp>
  • **ui**: Add html coverage &nbsp;-&nbsp; by @userquin and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3071 <samp>(e24cd)</samp>

๐Ÿ”ง Bug Fixes & Patches (6)

  • Don't call global setup teardown twice &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3188 <samp>(ba3d1)</samp>
  • Reporter to log version before provider initalizations &nbsp;-&nbsp; by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3131 <samp>(481b1)</samp>
  • Throw an error if Vitest cannot access its internal state &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3250 <samp>(fbb14)</samp>
  • Warning suppression broken &nbsp;-&nbsp; by @IceQub3 in https://github.com/vitest-dev/vitest/issues/3270 and https://github.com/vitest-dev/vitest/issues/3271 <samp>(036de)</samp>
  • Show correct diff in "toHaveBeenCalledWith" &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3289 <samp>(19fcd)</samp>
  • Don't print esm warning, if package name is not found &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3292 <samp>(62c14)</samp>
๐Ÿ“„ View Raw Release Notes (Original Developer Log)
### &nbsp;&nbsp;&nbsp;๐Ÿšจ Breaking Changes - Remove `browser` from allowed pools inside `poolMatchGlob` config option. Please, use Vitest workspaces for running tests in the browser. - Move assertion declarations to expect package &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3294 [<samp>(cf3af)</samp>](https://github.com/vitest-dev/vitest/commit/cf3afe2b) - The change should be minor: ```diff - declare namespace Vi { + declare module 'vitest' { interface Assertion<T = any> extends CustomMatchers<T> {} interface AsymmetricMatchersContaining extends CustomMatchers {} } ``` ### &nbsp;&nbsp;&nbsp;๐Ÿš€ Features - Update mock implementation to support ESM runtime, introduce "vi.hoisted" &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3258 [<samp>(0c09a)</samp>](https://github.com/vitest-dev/vitest/commit/0c09a40d) - Bypass ESM import order restriction with `vi.hoisted` to run code before imports are executed: ```ts vi.hoisted(() => vi.setSystemTime(new Date(2022, 1, 1))) ``` You can also use it to pass variables to `vi.mock`: ```ts const { mockedMethod } = vi.hoisted(() => { return { mockedMethod: vi.fn() } }) vi.mock('./path/to/module.js', () => { return { originalMethod: mockedMethod } }) ``` - Add repeat method to tests &nbsp;-&nbsp; by @samkevin1 in https://github.com/vitest-dev/vitest/issues/2652 [<samp>(7c8f0)</samp>](https://github.com/vitest-dev/vitest/commit/7c8f0ba9) - Add an option to hide skipped test lines &nbsp;-&nbsp; by @g4rry420 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2745 [<samp>(9bdb1)</samp>](https://github.com/vitest-dev/vitest/commit/9bdb1603) - **coverage**: Watermarks for c8 &nbsp;-&nbsp; by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3254 [<samp>(730af)</samp>](https://github.com/vitest-dev/vitest/commit/730af0b4) - **ui**: Add html coverage &nbsp;-&nbsp; by @userquin and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3071 [<samp>(e24cd)</samp>](https://github.com/vitest-dev/vitest/commit/e24cd9b2) - **watch**: Test run cancelling, feat: `--bail` option for cancelling test run &nbsp;-&nbsp; by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3163 [<samp>(8d460)</samp>](https://github.com/vitest-dev/vitest/commit/8d4606eb) ### &nbsp;&nbsp;&nbsp;๐Ÿž Bug Fixes - Don't call global setup teardown twice &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3188 [<samp>(ba3d1)</samp>](https://github.com/vitest-dev/vitest/commit/ba3d1338) - Reporter to log version before provider initalizations &nbsp;-&nbsp; by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3131 [<samp>(481b1)</samp>](https://github.com/vitest-dev/vitest/commit/481b1fd2) - Throw an error if Vitest cannot access its internal state &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3250 [<samp>(fbb14)</samp>](https://github.com/vitest-dev/vitest/commit/fbb1468e) - Warning suppression broken &nbsp;-&nbsp; by @IceQub3 in https://github.com/vitest-dev/vitest/issues/3270 and https://github.com/vitest-dev/vitest/issues/3271 [<samp>(036de)</samp>](https://github.com/vitest-dev/vitest/commit/036de797) - Show correct diff in "toHaveBeenCalledWith" &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3289 [<samp>(19fcd)</samp>](https://github.com/vitest-dev/vitest/commit/19fcd8df) - Don't print esm warning, if package name is not found &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3292 [<samp>(62c14)</samp>](https://github.com/vitest-dev/vitest/commit/62c14cba) - Support exactOptionalPropertyTypes &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3293 [<samp>(ba81d)</samp>](https://github.com/vitest-dev/vitest/commit/ba81d8a3) - Don't inline vite hmr and rollup types &nbsp;-&nbsp; by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3291 [<samp>(1f118)</samp>](https://github.com/vitest-dev/vitest/commit/1f1189bc) - **browser**: - Failing to load vitest/utils &nbsp;-&nbsp; by @userquin in https://github.com/vitest-dev/vitest/issues/3190 [<samp>(78bad)</samp>](https://github.com/vitest-dev/vitest/commit/78bad4ab) - **coverage**: - `thresholdAutoUpdate` to work with `perFile` &nbsp;-&nbsp; by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3182 [<samp>(29eeb)</samp>](https://github.com/vitest-dev/vitest/commit/29eebf65) - Throw error if fail to load built-in provider &nbsp;-&nbsp; by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3217 [<samp>(0a287)</samp>](https://github.com/vitest-dev/vitest/commit/0a2875e3) - Stackblitz hangs with c8 &nbsp;-&nbsp; by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3225 [<samp>(d9fda)</samp>](https://github.com/vitest-dev/vitest/commit/d9fda2a1) - C8 to ignore vite's generated helpers &nbsp;-&nbsp; by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3241 [<samp>(21942)</samp>](https://github.com/vitest-dev/vitest/commit/21942db0) - Workspaces c8 source maps &nbsp;-&nbsp; by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3226 [<samp>(efce3)</samp>](https://github.com/vitest-dev/vitest/commit/efce3b4d) - **docs**: - Correct typo and broken link to WebdriverIO &nbsp;-&nbsp; by @nathanbabcock in https://github.com/vitest-dev/vitest/issues/3275 [<samp>(c7da1)</samp>](https://github.com/vitest-dev/vitest/commit/c7da155f) - **spy**: - Update to set initial implementation through normal logic &nbsp;-&nbsp; by @Codex- in https://github.com/vitest-dev/vitest/issues/3260 and https://github.com/vitest-dev/vitest/issues/3263 [<samp>(c759a)</samp>](https://github.com/vitest-dev/vitest/commit/c759a9aa) - **vite-node**: - Circular imports &nbsp;-&nbsp; by @antfu in https://github.com/vitest-dev/vitest/issues/3196 [<samp>(cbb59)</samp>](https://github.com/vitest-dev/vitest/commit/cbb593a8) - Add missing `import.meta.hot.send` mock &nbsp;-&nbsp; by @antfu [<samp>(b1624)</samp>](https://github.com/vitest-dev/vitest/commit/b1624db5) - **vitest**: - Also check for vite relative to vitest package &nbsp;-&nbsp; by @JoshuaKGoldberg and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3274 [<samp>(a3393)</samp>](https://github.com/vitest-dev/vitest/commit/a3393b15) - **watch**: - Run test files when added to filesystem &nbsp;-&nbsp; by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3189 [<samp>(7b2c8)</samp>](https://github.com/vitest-dev/vitest/commit/7b2c81bc) ##### &nbsp;&nbsp;&nbsp;&nbsp;[View changes on GitHub](https://github.com/vitest-dev/vitest/compare/v0.30.1...v0.31.0)