Skip to content

Commit c936f14

Browse files
committed
Update repo readme
1 parent ad93c34 commit c936f14

File tree

1 file changed

+52
-55
lines changed

1 file changed

+52
-55
lines changed

README.md

Lines changed: 52 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ The next iteration of Vue Test Utils. It targets Vue 3.
77
- yarn: `yarn add @vue/test-utils@next --dev`
88
- npm: `npm install @vue/test-utils@next --save-dev`
99

10+
Get started with the [documentation](https://vue-test-utils.vuejs.org/v2/).
11+
1012
## Coming from Vue 2 + Vue Test Utils?
1113

1214
We are working on [some documentation to help people migrate](https://vue-test-utils.vuejs.org/v2/guide/migration.html).
@@ -19,27 +21,23 @@ There is [`vue-jest`](https://github.com/vuejs/vue-jest) for loading `.vue` file
1921

2022
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).
2123

22-
## Docs
24+
## What works?
2325

24-
Docs are located in [this repo](https://github.com/vuejs/vue-test-utils-next-docs). Read them [here](https://vue-test-utils.vuejs.org/v2/). They are in a separate repository because running Vuepress alongside a repo with Vue 3 causes conflicts - Vuepress expects to be running against Vue 2. This seems like the most simple solution for now.
26+
See the [docs](https://vuejs.github.io/vue-test-utils-next-docs/guide/introduction.html).
2527

2628
## Development
2729

2830
It's a pretty small codebase at the moment. Get started by running `yarn install`. You can run the tests with `yarn test`. That's it!
2931

3032
There is still some work left to do. See issues for some basic TODOs, or the table at the bottom of this page.
3133

32-
## What works?
33-
34-
See the [docs](https://vuejs.github.io/vue-test-utils-next-docs/guide/introduction.html).
35-
3634
## Contributing
3735

3836
This is still quite alpha, but we plan on moving to RC sooner than later. If you want to add a feature, have a hack or ping someone in Discord to chat, or check out the issues and project board.
3937

4038
There's also some [work left to do in docs](https://github.com/vuejs/vue-test-utils-next-docs/issues).
4139

42-
## Comparsion with Vue Test Utils beta (targeting Vue 2)
40+
## Comparison with Vue Test Utils beta (targeting Vue 2)
4341

4442
This is table for those coming from VTU 1, comparing the two APIs. Some things are still a work in progress.
4543

@@ -49,54 +47,53 @@ This is table for those coming from VTU 1, comparing the two APIs. Some things a
4947

5048
### Mounting Options
5149

52-
| option | status | notes |
53-
|---------|-------|------|
54-
data | ✅
55-
slots | ✅ | has not been tested vigorously. Please try it out.
56-
mocks | ✅ | nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global)
57-
propsData | ✅ | now called `props`
58-
provide | ✅ | nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global)
59-
mixins | ✅ | (new!) nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global)
60-
plugins | ✅ | (new!) nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global)
61-
component | ✅ | (new!) nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global)
62-
directives | ✅ | (new!) nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global)
63-
stubs | ✅
64-
attachToDocument |✅| renamed `attachTo`. See [here](https://github.com/vuejs/vue-test-utils/pull/1492)
65-
attrs | ✅
66-
scopedSlots | ⚰️ | scopedSlots are merged with slots in Vue 3
67-
context | ⚰️ | different from Vue 2, does not make sense anymore.
68-
localVue | ⚰️ | may not make sense anymore since we do not mutate the global Vue instance in Vue 3.
69-
listeners | ⚰️ | no longer exists in Vue 3
70-
parentComponent | ⚰️ |
71-
50+
| option | status | notes |
51+
| ---------------- | ------ | ----------------------------------------------------------------------------------------- |
52+
| data ||
53+
| slots || has not been tested vigorously. Please try it out. |
54+
| mocks || nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global) |
55+
| propsData || now called `props` |
56+
| provide || nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global) |
57+
| mixins || (new!) nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global) |
58+
| plugins || (new!) nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global) |
59+
| component || (new!) nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global) |
60+
| directives || (new!) nested in [`global`](https://vuejs.github.io/vue-test-utils-next-docs/api/#global) |
61+
| stubs ||
62+
| attachToDocument || renamed `attachTo`. See [here](https://github.com/vuejs/vue-test-utils/pull/1492) |
63+
| attrs ||
64+
| scopedSlots | ⚰️ | scopedSlots are merged with slots in Vue 3 |
65+
| context | ⚰️ | different from Vue 2, does not make sense anymore. |
66+
| localVue | ⚰️ | may not make sense anymore since we do not mutate the global Vue instance in Vue 3. |
67+
| listeners | ⚰️ | no longer exists in Vue 3 |
68+
| parentComponent | ⚰️ |
7269

7370
### Wrapper API (mount)
7471

75-
| method | status | notes |
76-
|---------|-------|------|
77-
attributes | ✅
78-
classes | ✅
79-
exists | ✅
80-
find | ✅ | only `querySelector` syntax is supported. `find(Comp)` under discussion [here](https://github.com/vuejs/vue-test-utils/issues/1498)
81-
emitted | ✅
82-
findAll | ✅ | see above. `.vm` is different to Vue 2. We are exploring options.
83-
get | ✅
84-
html | ✅
85-
setValue | ✅ | works for select, checkbox, radio button, input, textarea. Returns `nextTick`.
86-
text | ✅ |
87-
trigger | ✅ | returns `nextTick`. You can do `await wrapper.find('button').trigger('click')`
88-
setProps | ✅ |
89-
props | ✅
90-
setData | ✅ |
91-
destroy | ✅ | renamed to `unmount` to match Vue 3 lifecycle hook name.
92-
props | ✅
93-
isVisible | ✅
94-
contains | ⚰️| use `find`
95-
emittedByOrder | ⚰️ | use `emitted`
96-
setSelected | ⚰️ | now part of `setValue`
97-
setChecked | ⚰️| now part of `setValue`
98-
is | ⚰️
99-
isEmpty | ⚰️ | use matchers such as [this](https://github.com/testing-library/jest-dom#tobeempty)
100-
isVueInstance | ⚰️
101-
name | ⚰️ |
102-
setMethods | ⚰️ |
72+
| method | status | notes |
73+
| -------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
74+
| attributes | |
75+
| classes | |
76+
| exists | |
77+
| find | | only `querySelector` syntax is supported. `find(Comp)` under discussion [here](https://github.com/vuejs/vue-test-utils/issues/1498) |
78+
| emitted | |
79+
| findAll | | see above. `.vm` is different to Vue 2. We are exploring options. |
80+
| get | |
81+
| html | |
82+
| setValue | | works for select, checkbox, radio button, input, textarea. Returns `nextTick`. |
83+
| text | |
84+
| trigger | | returns `nextTick`. You can do `await wrapper.find('button').trigger('click')` |
85+
| setProps | |
86+
| props | |
87+
| setData | |
88+
| destroy | | renamed to `unmount` to match Vue 3 lifecycle hook name. |
89+
| props | |
90+
| isVisible | |
91+
| contains | ⚰️ | use `find` |
92+
| emittedByOrder | ⚰️ | use `emitted` |
93+
| setSelected | ⚰️ | now part of `setValue` |
94+
| setChecked | ⚰️ | now part of `setValue` |
95+
| is | ⚰️ |
96+
| isEmpty | ⚰️ | use matchers such as [this](https://github.com/testing-library/jest-dom#tobeempty) |
97+
| isVueInstance | ⚰️ |
98+
| name | ⚰️ |
99+
| setMethods | ⚰️ |

0 commit comments

Comments
 (0)