vuex-tester
mock the vuex environment to run your commit and dispatch without any extra adjustment, test as closer as possible to your product environment.
NO NEED to split your actions and mutations
full flow test is best test.
; const store = namespace: true state: abc: 1 mutations: { stateabc = payload; } { stateabc = stateabc + payload; } actions: { console; context; } getters: { console; return stateabc + 1; } modules: sub: namespace: true state: cbd: 100 mutations: { statecbd = payload; } { console; statecbd = statecbd - payload; console; } actions: { console; context; } getters: { console; return statecbd - 1; } modules: subTie: namespace: true state: xyz: 55 mutations: { statexyz = payload; } { statexyz = statexyz * payload; } actions: { console; context; } getters: { console; return statexyz * 2; } ; const state commit dispatch = store;// if you just want to test the part of subTie, just like this;// const { state, commit, dispatch } = new VuexTester(store.modules.sub.modules.subTie, 'sub/subTie').update(); ;;;;;;