@@ -99,12 +99,13 @@ npm install --save-dev vue-testing-library
9999< / template>
100100
101101// src/TestComponent.spec.js
102+ import ' jest-dom/extend-expect'
102103import { render } from ' vue-testing-library'
103104import TestComponent from ' ./TestComponent'
104105
105106test (' should render HelloWorld' , () => {
106107 const { queryByTestId } = render (TestComponent)
107- expect (queryByTestId (' test1' ). textContent ). toBe (' Hello World' )
108+ expect (queryByTestId (' test1' )). toHaveTextContent (' Hello World' )
108109})
109110
110111```
@@ -115,14 +116,14 @@ The `render` function takes up to 3 parameters and returns an object with some h
115116
1161171 . Component - the Vue component to be tested.
1171182 . 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
119119* store - The object definition of a Vuex store, if present ` render ` will configure a Vuex store and pass to mount.
120120* 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.
1211223 . configurationCb - A callback to be called passing the Vue instance when created. This allows 3rd party plugins to be installed prior to mount.
122123
123124### fireEvent
124125
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.
126127
127128### wait
128129
@@ -148,4 +149,14 @@ Feel free to contribute more!
148149
149150## LICENSE
150151
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