$ the-wire · showcase
Vitest Browser Mode config sharing fix lands in Vue Test Utils
By RepoJournal · Filed · About Vue.js
Vue Test Utils now shares a single configuration object across CJS and ESM builds, fixing integrations like vue-router-mock in Vitest Browser Mode without consumer workarounds.
Vue Test Utils' CJS and ESM builds could create separate configuration objects in the same JavaScript realm, making changes through one build invisible to the other. The fix shares configuration through a versioned global symbol, so all builds use the same state, fixing vue-router-mock in Vitest Browser Mode [1].
The same release brings corrected findComponent types for generic Single File Components [2]. Vue's `<script setup generic>` syntax exposes a generic call signature, so the type overloads fell through to a DOMWrapper; it now returns VueWrapper as expected, with regression coverage added [2].
On the Vapor side, hydration anchors are resolved by SSR fragment range [3], and type fixes refine native element refs, slot types, and the node type returned by defineComponent [4]. In VitePress, the theme decouples VPButton height from line-height [5].
Action items
- → Monitor test-utils builds for the config-sharing fix if you use Vitest Browser Mode with vue-router-mock vuejs/test-utils [immediate]
- → Update type expectations for generic SFC findComponent calls in tests using Vue Test Utils vuejs/test-utils [plan]
- → Review hydration behavior in vue-jsx-vapor if you SSR and hydrate fragments vuejs/vue-jsx-vapor [monitor]
References
- [1] fix: share config across builds ↗ vuejs/test-utils
- [2] Fix generic SFC findComponent types ↗ vuejs/test-utils
- [3] fix(runtime-vapor): resolve hydration anchors by SSR fragment range ↗ vuejs/vue-jsx-vapor
- [4] fix(types): correct native element ref and slot types ↗ vuejs/vue-jsx-vapor
- [5] fix(theme): decouple VPButton height from line-height (#5421) ↗ vuejs/vitepress