-
Notifications
You must be signed in to change notification settings - Fork 20
docs: vuex #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: vuex #41
Conversation
``` | ||
|
||
The [Vue Testing Handbook](https://lmiller1990.github.io/vue-testing-handbook/testing-vuex.html) has more examples for testing Vuex. Note: the examples pertain to Vue.js 2 and Vue Test Utils v1. The ideas and concepts are the same, and the Vue Testing Handbook will be updated for Vue.js 3 and Vue Test Utils 2 in the near future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to plug my own guide lol. I will have it up to date with VTU v2 soon :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, as usual! 🤗 added some thoughts here and there (as usual, too 😄 )
|
||
```js | ||
test('vuex', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add the imports here, to show that we're importing and using the real store, as the component does 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually just writing them all in one file - I'll make this more clear.
src/guide/vuex.md
Outdated
}) | ||
|
||
expect(wrapper.html()).toContain('Count: 1') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took me a while to realise that we weren't really interacting with the store even if we're checking "Count: 1" is there – just like the example above 😅 Can we init state.count
in a different value, say 25 or whatever?
src/guide/vuex.md
Outdated
|
||
```js | ||
test('increment mutation', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be wise to add a second test case here, to show how createVuexStore
is reused ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is a good idea
Co-authored-by: Adrià Fontcuberta <[email protected]>
Done |
great! |
Quick one, feel like I've written a "how to test vuex" article quite a few times by this point. We can make this more longer and detailed in the future if need be! Just trying to get something basic for each section before Vue 3 is official released.
resolves #8