โ ๏ธ 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.
โก 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" - 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 - by @samkevin1 in https://github.com/vitest-dev/vitest/issues/2652 <samp>(7c8f0)</samp>
- Add an option to hide skipped test lines - by @g4rry420 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2745 <samp>(9bdb1)</samp>
- **coverage**: Watermarks for c8 - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3254 <samp>(730af)</samp>
- **ui**: Add html coverage - 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 - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3188 <samp>(ba3d1)</samp>
- Reporter to log version before provider initalizations - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3131 <samp>(481b1)</samp>
- Throw an error if Vitest cannot access its internal state - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3250 <samp>(fbb14)</samp>
- Warning suppression broken - 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" - 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 - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3292 <samp>(62c14)</samp>
๐ View Raw Release Notes (Original Developer Log)
### ๐จ 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 - 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 {}
}
```
### ๐ Features
- Update mock implementation to support ESM runtime, introduce "vi.hoisted" - 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 - 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 - 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 - 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 - 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 - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3163 [<samp>(8d460)</samp>](https://github.com/vitest-dev/vitest/commit/8d4606eb)
### ๐ Bug Fixes
- Don't call global setup teardown twice - 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 - 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 - 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 - 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" - 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 - 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 - 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 - 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 - 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` - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - by @antfu [<samp>(b1624)</samp>](https://github.com/vitest-dev/vitest/commit/b1624db5)
- **vitest**:
- Also check for vite relative to vitest package - 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 - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3189 [<samp>(7b2c8)</samp>](https://github.com/vitest-dev/vitest/commit/7b2c81bc)
##### [View changes on GitHub](https://github.com/vitest-dev/vitest/compare/v0.30.1...v0.31.0)