Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ The next iteration of Vue Test Utils. It targets Vue 3.

## Coming from Vue 2 + Vue Test Utils beta?

We are working on some documentation to help people migrate. At this point it will you will have better luck trying this out with a brand new Vue 3 app, as opposed to upgrading an existing Vue 2 app. Feedback and bug reports are welcome!
We are working on some documentation to help people migrate. At this point you will have better luck trying this out with a brand new Vue 3 app, as opposed to upgrading an existing Vue 2 app. Feedback and bug reports are welcome!

## Working with `.vue` files

There is [`vue-jest`](https://github.com/vuejs/vue-jest) for loading `.vue` files into Jest. The `next` branch contains support for Vue 3. Install it with `yarn add vue-jest@next`. It lacks support for some things, namely JSX.
There is [`vue-jest`](https://github.com/vuejs/vue-jest) for loading `.vue` files into Jest. The `next` branch contains support for Vue 3. Install it with `yarn add vue-jest@next`. It lacks support for some things, namely JSX.

If you don't want to configure things, you can download a repository with Vue 3, `@vue/test-utils@next`, `vue-jest@next` and TypeScript configured [here](https://github.com/lmiller1990/vtu-next-demo).

Expand Down Expand Up @@ -60,9 +60,9 @@ mixins | ✅ | (new!) nested in [`global`](https://vuejs.github.io/vue-test-util
plugins | ✅ | (new!) nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global)
component | ✅ | (new!) nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global)
directives | ✅ | (new!) nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global)
stubs | ✅
stubs | ✅
attachToDocument |✅| renamed `attachTo`. See [here](https://github.com/vuejs/vue-test-utils/pull/1492)
attrs | ✅
attrs | ✅
scopedSlots | ⚰️ | scopedSlots are merged with slots in Vue 3
context | ⚰️ | different from Vue 2, does not make sense anymore.
localVue | ⚰️ | may not make sense anymore since we do not mutate the global Vue instance in Vue 3.
Expand All @@ -75,7 +75,7 @@ parentComponent | ⚰️ |
| method | status | notes |
|---------|-------|------|
attributes | ✅
classes | ✅
classes | ✅
exists | ✅
find | ✅ | only `querySelector` syntax is supported. `find(Comp)` under discussion [here](https://github.com/vuejs/vue-test-utils/issues/1498)
emitted | ✅
Expand All @@ -89,14 +89,14 @@ setProps | ✅ |
props | ✅
setData | ❌ | has PR
destroy | ✅ | renamed to `unmount` to match Vue 3 lifecycle hook name.
props | ✅
contains | ⚰️| use `find`
props | ✅
contains | ⚰️| use `find`
emittedByOrder | ⚰️ | use `emitted`
setSelected | ⚰️ | now part of `setValue`
setChecked | ⚰️| now part of `setValue`
is | ⚰️
setSelected | ⚰️ | now part of `setValue`
setChecked | ⚰️| now part of `setValue`
is | ⚰️
isEmpty | ⚰️ | use matchers such as [this](https://github.com/testing-library/jest-dom#tobeempty)
isVisible | ⚰️ | use matchers such as [this](https://github.com/testing-library/jest-dom#tobevisible)
isVueInstance | ⚰️
isVueInstance | ⚰️
name | ⚰️ |
setMethods | ⚰️ |
setMethods | ⚰️ |