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
vue: Clarify what the return value of the callback param does in render (testing-library#719)
* Clarify how the callback param works in `render`
I'm currently learning vue-testing-library and had some trouble trying to set up `vuex` instance with `simple-vuex`. I found out elsewhere that the best way to do this would be to use the callback parameter to return a store like
```tsx
const store = createVuexStore(new RootStore())
render(MyComponent, {props: {happy: true}}, () => ({ store }))
```
I think I could have noticed this sooner if the documentation described this line in the code: https://github.com/testing-library/vue-testing-library/blob/2312e180b12df3c599e8aa8a0ee85dcff7b108e7/src/vue-testing-library.js#L52. This is what i have tried to do in my proposed change above.
* Clarify that the return is merged with options, link to vue-i18n example
A callback function that receives the Vue instance as a parameter. This allows
85
-
3rd party plugins to be installed prior to mount.
84
+
A callback function that receives the Vue instance as a parameter. Its return value is merged with [options](#options), allowing
85
+
3rd party plugins to be installed prior to mount. To see how this works, see the example using [`vue-i18n`](https://github.com/testing-library/vue-testing-library/blob/master/src/__tests__/vue-i18n.js).
86
86
87
87
The function will also receive the Store or the Router object if the associated
0 commit comments