You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-31
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
<divalign="center">
2
-
<h1>Vue Testing Library</h1>
2
+
<h1>Vue Testing Library for Vue 3</h1>
3
3
4
4
<br />
5
5
@@ -15,11 +15,6 @@
15
15
<p>Simple and complete Vue.js testing utilities that encourage good testing practices.</p>
16
16
17
17
<p>Vue Testing Library is a lightweight adapter built on top of <ahref="https://github.com/testing-library/dom-testing-library/">DOM Testing Library</a> and <ahref="https://github.com/vuejs/vue-test-utils">@vue/test-utils</a>.</p>
18
-
19
-
20
-
<br />
21
-
22
-
<p>If you're looking for the Vue 3 version of Vue Testing Library, check out the <ahref="https://github.com/testing-library/vue-testing-library/tree/next">next</a> branch.</p>
23
18
24
19
<br />
25
20
@@ -66,30 +61,29 @@
66
61
This module is distributed via `npm` and should be installed as one of your
67
62
project's `devDependencies`:
68
63
69
-
If using Vue 2
70
-
```
71
-
npm install --save-dev @testing-library/vue@5
72
-
```
73
-
74
-
If using Vue 3
75
64
```
76
65
npm install --save-dev @testing-library/vue
77
66
```
78
67
79
-
This library has `peerDependencies` listings for `Vue` and
68
+
This library has `peerDependencies` listings for `Vue 3` and
80
69
`vue-template-compiler`.
81
70
82
-
You may also be interested in installing `@testing-library/jest-dom` so you can
83
-
use [the custom Jest matchers][jest-dom].
71
+
You may also be interested in installing `jest-dom` so you can use [the custom
72
+
Jest matchers][jest-dom].
73
+
74
+
If you're using Vue 2, please install version 5 of the library:
75
+
76
+
```
77
+
npm install --save-dev @testing-library/vue@^5
78
+
```
79
+
84
80
85
81
## A basic example
86
82
87
83
```html
88
84
<template>
89
-
<div>
90
-
<p>Times clicked: {{ count }}</p>
91
-
<button@click="increment">increment</button>
92
-
</div>
85
+
<p>Times clicked: {{ count }}</p>
86
+
<button@click="increment">increment</button>
93
87
</template>
94
88
95
89
<script>
@@ -133,9 +127,9 @@ test('increments value on click', async () => {
133
127
})
134
128
```
135
129
136
-
> You might want to install [`@testing-library/jest-dom`][jest-dom] to add handy
137
-
> assertions such as `.toBeInTheDocument()`. In the example above, you could
0 commit comments