-
Notifications
You must be signed in to change notification settings - Fork 110
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
'[vuex] must call Vue.use(Vuex) before creating a store instance' when changing tests order in src/tests/vuex.js #245
Comments
@adragich is correct that, if you're creating an instantiated store, you'll need to call To make this a bit clearer in the tests, I created #247 which explicitly calls |
Fixed in #247. Thank you both! |
Vue-testing-library Vuex unit test (src/tests/vuex.js) fails if you change tests order or remove ones with
renderVuexTestComponent
function. It's not a bug of library, but you should refactor your tests as you share these examples in official docs.To Reproduce Steps to reproduce the behavior:
Run test. Move 'can render with an instantiated Vuex store' test to top or remove test cases with
renderVuexTestComponent
function. Test fails.Expected behavior
Test passes.
Related information:
@testing-library/vue
version: 0.0.0-semantically-releasedVue
version: ^2.6.12node
version: v12.13.1npm
(oryarn
) version: yarn@1.22.10Relevant code or config (if any)
Additional context
I think you should discourage using instantiated store or show that initializing vuex on global Vue is okay (vuex does it anyways /~https://github.com/vuejs/vuex/blob/dev/src/store.js#L542).
The text was updated successfully, but these errors were encountered: