@@ -99,12 +99,13 @@ npm install --save-dev vue-testing-library
99
99
< / template>
100
100
101
101
// src/TestComponent.spec.js
102
+ import ' jest-dom/extend-expect'
102
103
import { render } from ' vue-testing-library'
103
104
import TestComponent from ' ./TestComponent'
104
105
105
106
test (' should render HelloWorld' , () => {
106
107
const { queryByTestId } = render (TestComponent)
107
- expect (queryByTestId (' test1' ). textContent ). toBe (' Hello World' )
108
+ expect (queryByTestId (' test1' )). toHaveTextContent (' Hello World' )
108
109
})
109
110
110
111
```
@@ -115,14 +116,14 @@ The `render` function takes up to 3 parameters and returns an object with some h
115
116
116
117
1 . Component - the Vue component to be tested.
117
118
2 . RenderOptions - an object containing additional information to be passed to @vue/test-utils mount. This can be:
118
- * props - The component props to be passed to TestComponent
119
119
* store - The object definition of a Vuex store, if present ` render ` will configure a Vuex store and pass to mount.
120
120
* routes - A set of routes, if present render will configure VueRouter and pass to mount.
121
+ All additional render options are passed to the vue-test-utils mount function in its options.
121
122
3 . configurationCb - A callback to be called passing the Vue instance when created. This allows 3rd party plugins to be installed prior to mount.
122
123
123
124
### fireEvent
124
125
125
- Lightweight wrapper around DOM element events and methods
126
+ Lightweight wrapper around DOM element events and methods. Will call wait, so can be awaited to allow effects to propagate.
126
127
127
128
### wait
128
129
@@ -148,4 +149,14 @@ Feel free to contribute more!
148
149
149
150
## LICENSE
150
151
151
- MIT
152
+ MIT
153
+
154
+ ## CONTRIBUTORS
155
+
156
+ [ ![ dfcook] ( https://avatars0.githubusercontent.com/u/10348212?v=3&s=200 )] ( https://github.com/dfcook )
157
+ [ ![ eunjae-lee] ( https://avatars0.githubusercontent.com/u/499898?v=3&s=200 )] ( https://github.com/eunjae-lee )
158
+ [ ![ tim-maguire] ( https://avatars0.githubusercontent.com/u/29452317?v=3&s=200 )] ( https://github.com/tim-maguire )
159
+ [ ![ samdelacruz] ( https://avatars0.githubusercontent.com/u/2040007?v=3&s=200 )] ( https://github.com/samdelacruz )
160
+ [ ![ ankitsinghaniyaz] ( https://avatars0.githubusercontent.com/u/11331989?v=3&s=200 )] ( https://github.com/ankitsinghaniyaz )
161
+ [ ![ lindgr3n] ( https://avatars0.githubusercontent.com/u/24882614?v=3&s=200 )] ( https://github.com/lindgr3n )
162
+ [ ![ kentcdodds] ( https://avatars0.githubusercontent.com/u/1500684?v=3&s=200 )] ( https://github.com/kentcdodds )
0 commit comments