vitejs / vite-plugin-vue2

Vite plugin for Vue 2.7
MIT License
551 stars 48 forks source link

[Vuex] namespaced modules are unreachable in tests #54

Open frsimond opened 2 years ago

frsimond commented 2 years ago

Reproduction

https://stackblitz.com/edit/vitest-vuex-vue2

Steps to reproduce the bug

Expected behavior

The tests should successfully access to the mocked namespaced module, and the expectations should pass.

Actual behavior

The tests fail and are preceded in console by multiple warnings (one for each vuex component namespaced mapper call) :

[vuex] module namespace not found in mapState(): nameOfTheNamespacedModuleTargeted/.
[vuex] module namespace not found in mapActions(): nameOfTheNamespacedModuleTargeted/

Additional information

I'm struggling between this repo and vitest's. I choosed this one because it is specific to the vue2 stack.

Another thing is that I succesfully tested a link to the root store (ie: not a namespaced module). So the non-namespaced mapped access to the store are working as expected.