// the find
posva/vuex-mock-store
✅Simple and straightforward Vuex Store mock for vue-test-utils
A test helper that replaces a real Vuex store with a mock that auto-spies on commit and dispatch. Aimed at Vue 2/3 component tests where you want to verify what mutations and actions a component triggers without running actual store logic. It's narrow in scope and does exactly one thing.
The pluggable spy interface is genuinely useful — swapping Jest for Sinon is a single constructor option, not a fork. The module state nesting mirrors Vuex's own API so mocking deeply nested module state isn't guesswork. Automatic reset via store.reset() in afterEach is a small thing that prevents a whole class of test pollution bugs. Active maintenance (last push July 2026 on a 271-star niche utility) is a good sign.
Vuex itself is in maintenance mode — Pinia is the official successor for Vue 3, so this library is solving a problem the ecosystem is migrating away from. The dispatch mock returns undefined by default instead of a resolved Promise, which silently breaks components that chain .then() on dispatch; you have to remember to set this up manually per test. No TypeScript-native story for typed state or getters — the .d.ts file is minimal and you lose type safety on store.state and store.getters. With only 19 forks and 271 stars, the bus factor is one (posva), and if he stops caring about Vuex compatibility, this goes unmaintained.