vue-test-utils-vuex-example
vue-test-utils-vuex-example copied to clipboard
Testing components with namespaced Vuex
Components using namespaced modules need: -to specify the namespace inside the component -testing: provide the whole store namespaced on new Vuex.Store
This makes the component to be coupled with the store and the namespace. When one needs to test an application with more than 50 nested modules, it's unmaintainable
Is the any way to inject to the component, as a prop or something, just the needed module of the store and keep the component module agnostic?
This would simplify a lot the tests and get rid of vuex warnings "module namespace not found..."
Hope I explained myself good enough, Thanks!