michaelolof / vuex-class-component

A Type Safe Vuex Module or Store Using ES6 Classes and ES7 Decorators written in TypeScript.
217 stars 21 forks source link

Cannot write independent tests because of module cache #101

Open timvahlbrock opened 3 years ago

timvahlbrock commented 3 years ago

Currently there is no possibility to create independent store instances to use for unit testing, because the module cache is reusing the same instance. There has been a function clearProxyCache, which is no out of used (it still exists but is literally empty). Perhaps something similar or a function to force the recreation of a store might be helpful. To help other users with this it would probably be good to re-add the "How to test" section to the readme that had been there in times of the clearProxyCache function.

timvahlbrock commented 3 years ago

This fork actually repurposed the clearProxyCache function to clear all of the caches in this commit.