~/talk

Testing vuex

Talkat Vue.js Summit 2018 · 2018-08-31..09-01· [testing, vue]
slides:none on file

Covers concrete advice for testing Vuex: three approaches—don't test the store, test actions/mutations/getters separately, or test a running store instance—with pros and cons. Shows Jest mocking to replace API calls, using createLocalVue to install Vuex without polluting global Vue, and recommends extracting a fresh store factory so each test gets a new state. Demonstrates dispatching an async fetch and asserting state update, trading brittle fine‑grained tests for easier refactoring with instance tests.

AI-written summary · about

  1. 0:00Introduction to unit testing
  2. 2:59Understanding the Vuex store
  3. 4:28The first approach: no testing
  4. 5:44Testing parts separately
  5. 10:45Testing the store instance
  6. 17:55Choosing an approach and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.