Releases: vuejs/test-utils
v2.0.0-rc.19
Several fixes. We will move from release candidate soon, hopefully this will be the last release candidate, unless any bugs are reported!
Features
feat: Add createStubs plugin hook
feat: support custom class component
Fixes
fix: added missing find overrides
fix: support functional component props
fix: do not match component name on getter that returns component
fix: static imports
fix: findAll root nodes when using render function
fix: stop globalProperties config leak
fix: add relative imports in wrapperLike interface
fix: add methods from baseWrapper to the wrapperLike interface
fix(type): add undefined type to attributes() for missing key #1398
fix(find): find element inside suspense with multi root elements #1397
fix(find): find and findAll should not find itself on DOM wrappers #1392
v2.0.0-rc.18
We are edging closer to a 2.0.0. This release contains many small fixes, mainly related to niche edge cases.
Fixes
fix: stringify symbol props in stubs (#1086)
fix: Remove methods key from mount (#1145)
Fix: Use defaultName when it exists to correctly stub async components (#1136)
fix(find): allow finding stubs by stub definition (#1113)
fix(emitted): do not track native events on multi-root components (#1121)
fix(html): ensure wrapper.html() works correctly for multi-root (#1120)
fix(find): implement proper find for multi-root components (#1116)
fix(find): do not find DOM node by ref if it is not inside element b118e9aa956a81997dc1276583c0f48c5a767387
fix(find): finding by ref may return Node, not just Element 125ea2fa6c0c757c0628f21aa1b1f60f996ca323
Other
chore(findComponent): refactor find & findComponent (fixes #716, #899)
chore(compat): Always treat legacy functional components as function bb44d9e4b92b852db7dc588c0d663f33739d41de
v2.0.0-rc.17
There is one minor breaking change that may impact people using shallowMount
with snaphots, see #1066.
Breaking
- fix: [BREAKING] Use default name for components with setup script and nameless component (#1066)
- [BREAKING] remove circular dep - DOMWrapper now requires the VueWrapper it is contained within as the second arg: #1093. This is to support finding a
VueWrapper
within aDOMWrapper
usingfindComponent
Features
- feat: add ability to stub teleport (#1087)
Fixes
- fix(compat): handle listeners, class and style in legacy functional (#1080)
- fix(mount): pass unknown options to $options on mount (#1079)
- fix(findComponent): favor displayName over name when searching (#1078)
- fix(find): Allow finding self from DOMWrapper (#1077)
- fix: expose with render function (#1067)
v2.0.0-rc.16
We are getting near to a 2.0.0. Follow this thread for details.
The main feature here is the return of the ability to use findComponent
with a DOM selector, for example findComponent('#some-id')
. Read more here: #689. Thanks @xanf and @cexbrayat for all the work!
Features
- feat: add enableAutoUnmount feature (#998)
Fixes
- fix: return ability to use findComponent with DOM selector (#994)
Other
- chore: bump to vue v3.2.16 and fix devtools (#971)
v2.0.0-rc.15
This release improves support for <script setup>
, and updates the Vue version, ensuring everything continues working with the latest version of Vue.
Features
- feat: expose everything on wrapper.vm (#931). This makes testing using
vm
the same when using<script setup>
A little controversial, the discussion is worth a look. Generally, you don't want to test or assert against values on vm
, but rather the public API (usually the rendered DOM).
- feat: export createWrapperError
Deps
- chore: bump to Vue 3.2.11
v2.0.0-rc.14
Features
This release only has one user facing change.
feat(find): allow chaining find with findComponent (#897)
v2.0.0-rc.13
This is huge release with many bug fixes. If this release breaks something for you, please file an issue.
The majority of this release was authored by @xanf - thank you for your ongoing efforts!
Breaking Changes
breaking: remove ability to use findComponent with DOM selector (#896)
Note: this may come back, it is an ongoing discussion. If you think it's important, you could make an issue. If you want to find a component, you generally can use findComponent
or getComponent
.
Fixes
fix(find): allow finding root without name (#836)
fix(slots): does not expose extra wrapper of slot content (#844)
fix(mount): support passing data when immediate watchers are present #840
fix(findComponent): return root instance if it matches (#834)
fix: do not crash findComponent if ref is pointing to html element (#817 …
fix(stubs): Do not create stubs across multiple renders (#813)
fix(stubs): Do not create stubs across multiple renders (#813)
fix(compat): avoid warning about non-existing export
fix: Always wrap string passed to slot in a helper component (#815) …
Other
chore(types): improve types of vueWrapper (#823) …
chore(types): add Array of strings as valid type for stubs
chore(types): add proper type for propsDeclaration
chore(types): improve global.stubs definition
chore(types): remove unused props in StubOptions
chore(stubs): simplify global stubs registration (#841)
chore(find): simplify vnode traversal (#835)
chore(deps): bump vue to 3.2 (#889)
v2.0.0-rc.12
Fixes
Fix a bug in rc.11 where the types were not correctly shipped. It's not clear why this happened - our build/release process has not changed in a long time. Apologies if you were on rc.11 and the types were not working as expected.
v2.0.0-rc.11
This release is quite small; one fix, some refactors and some updates to docs.
fix(setData): do not concat previous and new array values #767
refactor: use jest.advanceTimersByTime in async test #780
refactor: faster suspense test #779
chore: remove volar workaround #760
chore: rename slot variables in tests #759
chore: migrate example to TS #758
chore: format vue files #757
chore: remove allowJs from TS config #743
docs: update function name #789
docs: update url #776
docs: document .at
deprecation #736
docs: remove useless import (#735)
v2.0.0-rc.10
This is a big release with @xanf adding a lot of support for the Vue Compat build. We are now running against the latest Vue version (3.1.2).
Features
feat: support passing component with template to slots
feat(compat): support legacy functional components (#703)
feat(compat): correctly stub components, wrapped in Vue.extend
feat: add @vue/compat initial support (#698)
Fixes
fix(compat): do not stub legacy functional component root
fix(compat): correctly render default slot in stub if requested (#717)
fix: support passing functional components as stub implementation (#700)
fix: Allow finding component by definition when using shallow mount (#696)
fix: opt-out of stubbing by passing false as stub (#702)
fix: do not stub slots content when using shallow mount (#697)
fix: find component by its definition when using stub without name (#704 …
fix(shallow): correctly stub anonymous components (#714)
fix: findComponent should work using same stub for different components
Other
docs: add example of passing object with template property to slot
chore: improve typings of isComponent helpers
chore: Remove outdated comments about template object support in slots