~/talk

Unit testing Vue components Why test, what to test, and how to test Vue components

Talkat Vue.js Amsterdam 2018 · on Friday, 2018-02-16· [testing, vue]

Shows concrete, reproducible tests for a modal: using Jest + vue-jest + babel-jest to compile single-file components, mounting with vue-test-utils mount and wrapper.html, asserting wrapper.empty, using jest.fn() mocks for an onClose click and passing slot content, plus snapshot tests with vue snapshot serializer. Notes a performance finding — some runners do 5,000 tests in 38s vs >1h when compilation caching is wrong — and recommends using CLI patterns or webpack for predictable results.

AI-written summary · about

  1. 0:00Start
  2. 3:33Unit test benefits
  3. 6:18compiled SFC
  4. 6:34Compilation process
  5. 7:46Compilers
  6. 10:59mount
  7. 12:01Component contract
  8. 13:02Input
  9. 14:18Modal component
  10. 19:38Snapshot tests
  11. 21:19First run
  12. 22:51Overwrite snapshot
~/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.