Next Level Jest Testing
summary
Concrete techniques for testing Vue apps with Jest and Vue Test Utils are shown: use jest snapshots with property matchers and faker for sane randomness, test Vuex by calling mutations and resetting state or using state-as-function, fix cached singletons with jest.resetModules, mock Axios via Jest automock or __mocks__ for controlled responses, use fake timers and flush-promises for async, factor factories and createFactory for reusable mounts, use snapshot-diff and vue snap serializer, and ship a jest-acceptance tester that reduces test rewrites and works end to end.
AI-written summary · about
chapters (11)
- 0:00Start
- 1:37NEXT LEVEL JEST TESTING
- 2:08Hi, I'm Roman!
- 2:43Jumped on Vue with 0.11
- 6:30Testing a VUEX Store
- 15:01Custom Mocks!
- 16:35Components
- 19:13Duplication?
- 19:26Factories!
- 23:43Unit Tests Next Level
- 24:00Acceptance Tests
related talks
21mTesting Vue Apps
26mUnit testing Vue components Why test, what to test, and how to test Vue components
27mTesting vuex
30mTips, Tricks, and Best Practices
26mUnit testing a Vuex store
39m7 ways to make your Vue unit tests better
39mSpeed up your unit testing with Jest
23mSeven ways to make your Vue component tests better
