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
Run the fiddle - console error because this.$store is undefined on the child component.
What is expected?
All child components should receive the global $store mixin from Vuex.
What is actually happening?
Only the root element is receiving the $store property.
I can fix the jsbin by removing the Vue.extend notation and just passing the raw javascript objects into mount. I also confirmed that this works as expected when using Vue to construct the component normally (not using vue-test-utils).
I ran into this because I was using ES6 imports to import my store into all my app components. I switched to using this.$store which works fine in the app, but broke a lot of my unit tests that were using vue-test-utils to mount the components.