Chapter 7. Testing Vuex

This chapter covers

  • Adding Vuex to a project
  • Writing unit tests for Vuex store mutations, actions, and getters
  • Writing unit tests for a Vuex store instance
  • Writing unit tests for Vuex connected components

Vuex (a state-management library for Vue) is essential for large Vue apps. To become a Vue testing master, you should learn how to test Vuex effectively.

In this chapter, you’ll learn how to test a Vuex store and Vuex-connected components. To learn how to test Vuex, you’ll refactor the Hacker News application you’ve been working on to use Vuex.


This chapter doesn’t go into detail about Vuex basics. If you don’t already understand how getters, actions, and mutations are used to create a store, you should ...

Get Testing Vue.js Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.