Analysis updated 2026-08-03 · repo last pushed 2026-08-03
Test that clicking an add-to-cart button triggers the right Vuex action without running real store logic.
Verify a component reads the correct data from Vuex by hardcoding the expected values in a fake store.
Check that your component commits the right mutation when a user interacts with it, using built-in spies.
Run fast component tests in isolation by replacing the real Vuex store with a lightweight mock.
| posva/vuex-mock-store | sindresorhus/cat-names | gaearon/react-blessed-hot-motion | |
|---|---|---|---|
| Stars | 271 | 275 | 276 |
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | 2026-08-03 | 2024-04-30 | 2017-11-17 |
| Maintenance | Active | Dormant | Dormant |
| Setup difficulty | easy | easy | moderate |
| Complexity | 2/5 | 1/5 | 4/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
When you're building a Vue.js app, you often use a tool called Vuex to manage shared data across your components. When it comes time to write automated tests for those components, you usually don't want to run your real Vuex setup, because that drags in extra complexity and makes tests slower. This project solves that problem by giving you a lightweight, fake version of Vuex, often called a "mock", so you can test your components in isolation. The way it works is straightforward: you create a fake store and tell it exactly what data and computed values (getters) your component should see. It also automatically sets up monitors, called "spies", that watch whenever your component tries to change data or trigger an action. In your test, you can then simply check if the right button click sent the right signal, without actually executing the real logic behind it. This is useful for developers who want fast, reliable tests and don't want to worry about their Vuex logic breaking their component tests. For example, if you have a shopping cart counter component and want to verify that clicking the "add" button triggers an update, you can test that interaction directly. You focus only on whether the component asked the store to do something, rather than testing the entire store logic at the same time. A notable tradeoff is that this mock doesn't let you provide real functions for your getters, you must provide the exact value the getter should return. The creator intentionally made this choice: if you're testing a specific component, you already know the expected result, and hardcoding that value ensures your test stays completely focused and predictable.
A lightweight fake version of Vuex for Vue.js apps that lets you test components in isolation without running your real data store, with built-in spies to verify your component sends the right signals.
Mainly JavaScript. The stack also includes JavaScript, Vue.js, Vuex.
Active — commit in last 30 days (last push 2026-08-03).
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.