Repository navigation
Releases
Releases · vuejs/test-utils
v2.6.0
⚠️ Breaking change
Plain object and array props are no longer made deeply reactive. Tests relying on in-place mutations must wrap values in reactive() before mounting, or pass a new value to setProps. Passing the same mutated object to setProps does not trigger a re-render. Already-reactive props stay reactive. See #2951 and the migration guidance.
What's Changed
- feat(types): infer emitted event names and payload types by @niukanen1 in #2948
- feat: add TeleportStub and support custom components as built-in stubs by @simonyang08 in #2946
- feat: add VueWrapper.emit by @ValentinYoushkevich in #2998
- fix: keep the namespace prefix in attributes() by @MaxFreedomPollard in #2941
- fix: store props in shallow reactive to avoid deep propagation by @ackwell in #2951
- fix(types): infer emitted payloads for components with props by @ValentinYoushkevich in #2957
- fix: skip global mocks mixin when mocks are empty by @cexbrayat in #2962
- fix: record emitted events once when a devtools hook is installed by @ValentinYoushkevich in #2965
- fix(types): accept union-typed props in mount by @giaBaoJS in #2967
- fix: find elements and components inside multi-root functional components by @ValentinYoushkevich in #2971
- fix(#2333): keep props from mixins and extends in stubs by @ValentinYoushkevich in #2963
- fix: do not crash stubs on props without primitive conversion by @ValentinYoushkevich in #2975
- fix: support attachTo on Vue versions before 3.5 by @ValentinYoushkevich in #2974
- fix: apply global mocks named after internal instance fields by @ValentinYoushkevich in #2977
- fix: clear events emitted during unmount from the emitted history by @ondrhn in #2985
- fix: findComponent by selector on a functional root component by @ValentinYoushkevich in #2978
- fix: keep Map and Set values in setData by @mkantautas in #2980
- fix: stub directives registered with a camelCase or kebab-case name by @MaxFreedomPollard in #2982
- fix: use Vite mode to select the built package for tests by @cexbrayat in #2995
- fix: update the content of a teleport stubbed with a component by @ValentinYoushkevich in #2993
- fix: do not crash findComponent if ref points to an svg element by @NgoQuocViet2001 in #2983
- fix(stubs): skip component name lookups on re-render by @ondrhn in #2987
- fix(types): keep VueWrapper for findComponent with an any-typed selector by @ondrhn in #2973
- fix(#2541): stub globally registered components by their registration key by @ValentinYoushkevich in #2996
- fix: only apply stubs to the app being rendered by @ValentinYoushkevich in #2997
- fix: infer resolved types for defaulted wrapper props by @mvanhorn in #3003
- fix: render slots passed to a stubbed teleport or keep-alive by @ValentinYoushkevich in #3013
- fix(#2135): do not warn when mounting option slots are called outside render by @ValentinYoushkevich in #3014
New Contributors
- @MaxFreedomPollard made their first contribution in #2941
- @niukanen1 made their first contribution in #2948
- @ackwell made their first contribution in #2951
- @ValentinYoushkevich made their first contribution in #2957
- @Glandos made their first contribution in #2962
- @giaBaoJS made their first contribution in #2967
- @ondrhn made their first contribution in #2985
- @mkantautas made their first contribution in #2980
- @NgoQuocViet2001 made their first contribution in #2983
- @SuperDJ made their first contribution in #3010
Full Changelog: v2.5.1...v2.6.0
v2.5.1
What's Changed
- fix: generic SFC findComponent types by @simonyang08 in #2934
- fix: share config across builds by @cexbrayat in #2937
New Contributors
- @simonyang08 made their first contribution in #2934
Full Changelog: v2.5.0...v2.5.1
v2.5.0
What's Changed
- fix: keep re-rendering root component after another wrapper is mounted by @lazerg in #2890
- fix: correct
summaryelement behavior by @nn-morishita in #2806 - fix: clear emitted event history for child components on unmount by @ebiryu in #2898
- chore!: drop class component support by @cexbrayat in #2904
- fix: expose defineExpose bindings on findComponent vm by @adamberecz in #2927
New Contributors
- @MetRonnie made their first contribution in #2885
- @lazerg made their first contribution in #2890
- @bartlomieju made their first contribution in #2892
- @nn-morishita made their first contribution in #2806
- @ebiryu made their first contribution in #2898
- @chiaraani made their first contribution in #2916
- @souserge made their first contribution in #2695
- @adamberecz made their first contribution in #2927
Full Changelog: v2.4.11...v2.5.0
v2.4.11
🩹 Fixes
- Drop legacy Mutation Event listener entries (#2844)
- Handle
setData()correctly for components using bothsetup()anddata()(#2846) - Export
GlobalMountOptionstype (#2851) - Set spec-compliant
event.codeonkeydown/keyup(#2850)
❤️ Contributors
- Cédric Exbrayat (@cexbrayat)
- Renato de Leão (@renatodeleao)
- Matt Van Horn (@mvanhorn)
- Carsten Brachem (@cbrachem)
- Ahmad Hanan (@AhmadHannan037)
- Paul Cochrane (@paultcochrane)
- Arpit Jain (@arpitjain099)
v2.4.10
🩹 Fixes
- Restore text()/html() for single-root components (#2835)
❤️ Contributors
- Cédric Exbrayat (@cexbrayat)
- Lorenz van Herwaarden (@lorenzvanherwaarden)
v2.4.9
🩹 Fixes
- Tolerate duplicate attachTo cleanup (#2830)
📖 Documentation
- Document release process (#2834)
🏡 Chore
- Migrate renovate config (5d37934)
🤖 CI
- Pin github actions to commit hashes (75dcef3)
❤️ Contributors
- Cédric Exbrayat (@cexbrayat)
- Daniel Roe (@danielroe)
v2.4.8
🩹 Fixes
- Correct declaration entrypoint (#2826)
🤖 CI
- Enable pkg.pr.new (#2827)
❤️ Contributors
- Cédric Exbrayat (@cexbrayat)
- Daniel Roe (@danielroe)
v2.4.7
🚀 Enhancements
- Add Chinese docs translation (#2552)
- SetData()/shallowMount with initialData for components using the Composition API / <script setup> (#2655)
🩹 Fixes
- Preserve code from keyboard events (#2434)
- Switch browser and require exports definitions (#2501)
- Re-add peer dependencies but with wider range (#2511)
- Resolve warnings in docs:dev (30b7491)
- Resolve TypeScript type errors in .vitepress/config (#2549)
- Accept FunctionalComponent as selector (0bb947f)
- Text() misses content for array functional component (#2579)
- Use await in test (c5482b4)
- deps: Update dependency vue-component-type-helpers to v3 (#2683)
- Remove wrapper div when unmount (#2700)
- Make mount options slots compatible with noUncheckedIndexedAccess true (#2713)
- Add missing peerDependency @vue/compiler-dom (75801ba)
- docs: Declare css module for vitepress typecheck (ddaca97)
💅 Refactors
- Enforce consistent usage of type imports (#2734)
📖 Documentation
- Clarify findComponent vs getComponent (#2435)
- Update fr docs (67064ef)
- Add note about partial transition stub support (#2431)
- Fix missing data at passing data section essentials guide (dda205e)
- Fix missing data at passing data section essentials guide fr (ae2c72c)
- Fix plugin TS declaration example (#2466)
- Fixed incorrect checkbox value check (#2495)
- Capital letter in sentence fix (#2499)
- Import missing DOMWrapper on Implementation of the plugin section (#2519)
- Add migration step for deprecated ref syntax in findAllComponents (#2498)
- Correct anchor hash links and fix typo (#2551)
- Center logo on home (#2559)
- zh-cn: Review a-crash-course (#2563)
- Use code-group for install commands (#2571)
- zh-cn: Review event-handing.md (#2572)
- zh-cn: Enhance conditional-rendering.md (#2562)
- zh-cn: Review easy-to-test (#2567)
- zh-cn: Review passing-data.md (#2575)
- zh-cn: Review async-suspense.md (#2576)
- zh: 优化 API 文档格式和内容 (#2569)
- zh: 更新 Vitest 模拟日期和计时器的说明 (#2578)
- zh-cn: Review http-requests.md (#2580)
- zh-cn: Review forms (#2582)
- zh-cn: Guide/advanced/slots.md (#2565)
- zh: Review extending-vtu (#2583)
- zh: Review index (#2584)
- Fix modelValue test example (85bfdf4)
- Removes broken link from plugins.md (69bc1ce)
- zh: Review transitions, component-instance, and reusability-composition (#2616)
- zh: Review v-model and vuex (#2617)
- zh: Review all the rest advanced guide (#2619)
- zh: Review migration (#2623)
- Fix a typo in transitions.md (#2635)
- Update crash-course to script setup (c81aa79)
- Update Essentials section to setup (composition api) (#2647)
- Typos in examples (#2678)
- Typo in easy-to-test.md (#2710)
- Add note about mocking requestAnimationFrame for transitions (2324c65)
- Updated example TodoApp to script setup (#2727)
- Remove "Using data" section from "Conditional Rendering" guide and fix passing data test example (#2743)
- Follow-up fixes for the conditional rendering guide (#2744)
- Mention shallowMount stub name changes in migration guide (80e051a)
- Update conditional rendering documentation to clarify isVisible() usage with attachTo (#2799)
- Restore Options API component for data() mounting example (#2804)
- Promote Vitest as recommended test runner (#2805)
- api: Note that setValue does not accept objects on
<select>(#2819)
🏡 Chore
- Add api/index.md to docs:translation:compare (6b8681c)
- Remove unnecessary generic arguments (cfd70c6)
- Ignore TS error in config object (9d0a618)
- Simplify eslint packages (c1d0ffd)
- Use eslint v9 with flat config (2f19fdf)
- Expose Stubs type publicly (#2492)
- Update documentation file path (9c96594)
- Use pnpm v10 (e4c2cb3)
- Pnpm approve build (81c54e9)
- Use github issue forms (#2673)
- Exclude class components from test type-checking (0899008)
- Add explicit coverage include for vitest v4 (51672b9)
- Update to prettier v3.7 (fed9e7c)
- Migrate to oxfmt (81c1de9)
- Migrate to oxlint (a361908)
- Prepare TypeScript 6 migration settings (55e1262)
- Adjust tsd config for TypeScript 6 (7d23eb5)
- Avoid TypeScript 6 target deprecation warning (81d063c)
🤖 CI
- Remove node v22 build (7ebf58d)
- Add node v22 build (57540ee)
- Use "pool: threads" instead of vmThreads (d0cbb54)
- Remove node v18 and add v24 (fd9cf95)
- Add trusted publishing release workflow (#2825)
❤️ Contributors
- Lachlan Miller (@lmiller1990)
- cexbrayat (@cexbrayat)
- Nicolas Bonamy (@nbonamy)
- KatWorkGit (@KatWorkGit)
- Wouter Kroes (@wouterkroes)
- Rama Muhammad Murshal (@ramammurshal)
- Evan You (@yyx990803)
- Vlad Starkovsky (@starkovsky)
- Joe (@joaoprp)
- Priyadarshi Kumar (@Psingh132)
- Sébastien Ronveaux (@sronveaux)
- Gilliam (@Gi11i4m)
- Baranov Dmytro (@dimas7001)
- BrendonHenrique (@BrendonHenrique)
- Lorenz van Herwaarden (@lorenzvanherwaarden)
- wuzhiqing (@DDDDD12138)
- 阿菜 Cai (@RSS1102)
- Jinjiang (@Jinjiang)
- Kylin (@lxKylin)
- Qianhe Chen (@chenqianhe)
- 时瑶 (@KiritaniAyaka)
- h7ml (@h7ml)
- Nicander (@Nicander93)
- Take-John (@takejohn)
- ilyasherstoboev (@ilyasherstoboev)
- aimerie (@aimerie)
- Miguel Rincon (@miguelrincon)
- bcastlel (@bcastlel)
- Claudiu (@sofuxro)
- Artem Dragunov (@dragunovartem99)
- Robin (@OrbisK)
- Koen Mertens (@KCMertens)
- meomking (@CaptainWang98)
- Pepijn Olivier (@pepijnolivier)
- Tomina (@Thomaash)
- Gareth Jones (@G-Rath)
- Jerry Hogan (@hdJerry)
- Marco Pasqualetti (...
v2.4.6
What's Changed
- fix: circular references in props cause maximum call stack size exceeded by @Evobaso-J in #2371
- fix: update attachTo type in MountingOptions interface by @taku-y-9308 in #2375
- fix: change vm to always provide global property by @taku-y-9308 in #2386
- fix: renderStubDefaultSlot with scoped slots by @cexbrayat in #2397
- feat: Added dynamic return for element getter by @nandi95 in #2406
- fix(stubs): avoid warning on normalized props with Vue v3.4.22 by @cexbrayat in #2413
- fix: set global provides before running vue plugins by @danielroe in #2423
- fix: issue 2319 throw first error thrown during mount by @taku-y-9308 in #2428
New Contributors
- @Jinjiang made their first contribution in #2373
- @taku-y-9308 made their first contribution in #2375
- @matusekma made their first contribution in #2351
- @w2xi made their first contribution in #2398
- @brc-dd made their first contribution in #2403
- @KatWorkGit made their first contribution in #2422
Full Changelog: v2.4.5...v2.4.6
v2.4.5
What's Changed
- feat: add teleport stub possibility, https://github.com/vuejs/test-ut… by @blizzardKv in #2336
- fix(findComponent): Use correct vm for stubbed component with selector by @freakzlike in #2327
- fix(teleport.md): fix missed "global" key, https://github.com/vuejs/t… by @blizzardKv in #2337
- fix(vue-router.md): update highlights when mocking real router by @dmoyadev in #2340
- fix(deps): update dependency vue-component-type-helpers to v2 by @renovate in #2358
- fix: Allow access to nested computed values (fix #2196) by @Evobaso-J in #2356
- docs: add mention of enableAutoDestroy replacement by @strokirk in #2344
New Contributors
- @blizzardKv made their first contribution in #2336
- @dmoyadev made their first contribution in #2340
- @strokirk made their first contribution in #2344
- @Evobaso-J made their first contribution in #2356
- @qmonmert made their first contribution in #2364
Full Changelog: v2.4.4...v2.4.5