unstale

npm / @vue/test-utils

@vue/test-utils

What changed in @vue/test-utils 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

4 breaking4 new APIs and options1 behavior and defaults1 tooling42 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@vue/test-utils 252 changes

Breaking changes 4

  • Plain object and array props are no longer made deeply reactive. Wrap values in reactive() before mounting or pass a new value to setProps; already-reactive props stay reactive.

    2.6.0release notes

  • Vue Test Utils no longer supports class components.

    2.5.0release notes

  • Legacy Mutation Event listener entries are dropped.

    2.4.11release notes

  • Browser and require export definitions are switched.

    2.4.7release notes

New APIs and options 4

Behavior and default changes 1

  • The vm returned by findComponent exposes defineExpose bindings.

    2.5.0release notes

Tooling 1

  • Emitted event names and payload types are inferred.

    2.6.0release notes

Fixes and other changes 42

  • attachTo is supported on Vue versions before 3.5.

    2.6.0release notes

  • attributes() now keeps the namespace prefix in attribute names.

    2.6.0release notes

  • Directives registered with camelCase or kebab-case names can now be stubbed.

    2.6.0release notes

  • Events emitted during unmount are cleared from emitted history, and events are recorded only once when a devtools hook is installed.

    2.6.0release notes

  • Element and component lookup now works inside multi-root functional components.

    2.6.0release notes

  • Selector lookup works when the root component is functional.

    2.6.0release notes

  • findComponent no longer crashes when a ref points to an SVG element.

    2.6.0release notes

  • Global mocks are applied even when named after internal instance fields.

    2.6.0release notes

  • mount now accepts union-typed props.

    2.6.0release notes

  • Mounting option slots called outside render no longer produce a warning.

    2.6.0release notes

  • setData now keeps Map and Set values.

    2.6.0release notes

  • Slots passed to a stubbed teleport or keep-alive are now rendered.

    2.6.0release notes

  • Stubs now retain props from mixins and extends.

    2.6.0release notes

  • Stubs no longer crash on props without primitive conversion.

    2.6.0release notes

  • Globally registered components can be stubbed by their registration key.

    2.6.0release notes

  • Stubs are now applied only to the app being rendered.

    2.6.0release notes

  • The content of a teleport stubbed with a component is now updated.

    2.6.0release notes

  • Resolved types for defaulted wrapper props are now inferred.

    2.6.0release notes

  • Fixes types for findComponent with generic SFCs.

    2.5.1release notes

  • Emitted event history for child components is cleared on unmount.

    2.5.0release notes

  • The root component continues re-rendering after another wrapper is mounted.

    2.5.0release notes

  • Corrects the behavior of the summary element.

    2.5.0release notes

  • keydown and keyup events set a spec-compliant event.code.

    2.4.11release notes

  • setData() is handled correctly for components using both setup() and data().

    2.4.11release notes

  • Restores text() and html() for single-root components.

    2.4.10release notes

  • Cleanup now tolerates duplicate attachTo cleanup.

    2.4.9release notes

  • Corrected the declaration entrypoint.

    2.4.8release notes

  • Keyboard events preserve their code value.

    2.4.7release notes

  • FunctionalComponent<any> is accepted as a selector.

    2.4.7release notes

  • Mount option slots are compatible with noUncheckedIndexedAccess set to true.

    2.4.7release notes

  • setData() and shallowMount with initialData support components using the Composition API and <script setup>.

    2.4.7release notes

  • text() now includes content for array functional components.

    2.4.7release notes

  • Unmounting removes the wrapper div.

    2.4.7release notes

  • The missing @vue/compiler-dom peer dependency is added.

    2.4.7release notes

  • Fixes the emitted events cache.

    2.0.0release notes

  • Fixes module resolution for ESM files.

    2.0.0release notes

  • Allows finding top-level components.

    2.0.0release notes

  • Passes props to functional components.

    2.0.0release notes

  • Fixes comparison of reactive prop objects.

    2.0.0release notes

  • Fixes string slots with a null context in renderFn.

    2.0.0release notes

  • Fixes wrapper.element for components with nested multiple roots.

    2.0.0release notes

  • Fixes wrapper.element for components with a slot.

    2.0.0release notes