1
1
<div align =" center " >
2
2
<h1 >Vue Testing Library</h1 >
3
3
4
+ <br />
5
+
4
6
<a href =" https://www.joypixels.com/emoji/1F98E " >
5
7
<img
6
8
height="80"
16
18
17
19
<br />
18
20
19
- [ ** Read the Docs ** ] [ docs ] | [ Edit the docs] [ docs-edit ]
21
+ [ ** Read the docs ** ] [ docs ] | [ Edit the docs] [ docs-edit ]
20
22
21
23
<br />
22
24
36
38
37
39
<h2 >Table of Contents</h2 >
38
40
41
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
42
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
43
+
39
44
- [ Installation] ( #installation )
40
45
- [ A simple example] ( #a-simple-example )
41
46
- [ More examples] ( #more-examples )
44
49
- [ License] ( #license )
45
50
- [ Contributors] ( #contributors )
46
51
52
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
53
+
47
54
## Installation
48
55
49
- This module is distributed via npm and should be installed as one of your
56
+ This module is distributed via ` npm ` and should be installed as one of your
50
57
project's ` devDependencies ` :
51
58
52
59
```
@@ -57,7 +64,7 @@ This library has `peerDependencies` listings for `Vue` and
57
64
` vue-template-compiler ` .
58
65
59
66
You may also be interested in installing ` jest-dom ` so you can use
60
- [ the custom Jest matchers] ( https://github.com/gnapse /jest-dom#readme ) .
67
+ [ the custom Jest matchers] ( https://github.com/testing-library /jest-dom#readme ) .
61
68
62
69
## A simple example
63
70
@@ -90,7 +97,7 @@ import {render, fireEvent} from '@testing-library/vue'
90
97
import TestComponent from ' ./TestComponent.vue'
91
98
92
99
test (' increments value on click' , async () => {
93
- // The render method returns a collection of utilities to query your component.
100
+ // The render method returns a collection of utilities to query the component.
94
101
const {getByText } = render (TestComponent)
95
102
96
103
// getByText returns the first matching node for the provided text, and
@@ -100,7 +107,7 @@ test('increments value on click', async () => {
100
107
// `button` is the actual DOM element.
101
108
const button = getByText (' increment' )
102
109
103
- // Dispatch a native click event .
110
+ // Dispatch a couple of native click events .
104
111
await fireEvent .click (button)
105
112
await fireEvent .click (button)
106
113
@@ -124,12 +131,12 @@ Feel free to contribute with more examples!
124
131
125
132
## Docs
126
133
127
- [ ** Read the Docs ** ] [ docs ] | [ Edit the docs] [ docs-edit ]
134
+ [ ** Read the docs ** ] [ docs ] | [ Edit the docs] [ docs-edit ]
128
135
129
136
## Typings
130
137
131
138
The TypeScript type definitions are in the
132
- [ DefinitelyTyped repo] ( https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/ types/testing-library__vue )
139
+ [ DefinitelyTyped repo] [ types ]
133
140
and bundled with Vue Testing Library.
134
141
135
142
## License
@@ -166,13 +173,14 @@ and bundled with Vue Testing Library.
166
173
[ npm ] : https://badge.fury.io/js/%40testing-library%2Fvue
167
174
[ license-badge ] : https://img.shields.io/github/license/testing-library/vue-testing-library.svg
168
175
[ license ] : https://github.com/testing-library/vue-testing-library/blob/master/LICENSE
176
+ [ types ] : https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__vue
169
177
170
178
[ docs ] : https://testing-library.com/vue
171
179
[ docs-edit ] : https://github.com/testing-library/testing-library-docs
172
180
173
- [ test-directory ] : https://github.com/testing-library/vue-testing-library/tree /master/tests /__tests__
174
- [ vuex-example ] : https://github.com/testing-library/vue-testing-library/tree /master/tests /__tests__/vuex.js
175
- [ vue-router-example ] : https://github.com/testing-library/vue-testing-library/tree /master/tests /__tests__/vue-router.js
176
- [ vee-validate-example ] : https://github.com/testing-library/vue-testing-library/tree /master/tests /__tests__/validate-plugin.js
181
+ [ test-directory ] : https://github.com/testing-library/vue-testing-library/blob /master/src /__tests__
182
+ [ vuex-example ] : https://github.com/testing-library/vue-testing-library/blob /master/src /__tests__/vuex.js
183
+ [ vue-router-example ] : https://github.com/testing-library/vue-testing-library/blob /master/src /__tests__/vue-router.js
184
+ [ vee-validate-example ] : https://github.com/testing-library/vue-testing-library/blob /master/src /__tests__/validate-plugin.js
177
185
[ vue-i18n-example ] : https://github.com/testing-library/vue-testing-library/blob/master/tests/__tests__/vueI18n.js
178
186
<!-- prettier-ignore-end -->
0 commit comments