Testable Nuxt
summary
A Nuxt pizza store demo shows which tests matter: unit tests for pure functions, split composables to avoid mocking useFetch, and shallow mounting for component logic. Use Vitest config separate with ntest utils and jsdom, mock $fetch when needed, and prefer Playwright for E2E interaction using page.locator and data-test-id selectors. Also run server page checks via ntest fetch to assert rendered HTML and aim for 80% coverage as a practical target.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:50I hate test
- 2:48Planning
- 5:59Unit Testing
- 14:06Component Testing
- 16:48Interaction Test
- 18:45Playground Test
- 20:49Other Tools
- 22:14QA
related talks
26mWe May Not Need Component Testing
41mWe may not need component (unit) testing
30mTips, Tricks, and Best Practices
26mUnit testing a Vuex store
39m7 ways to make your Vue unit tests better
34mComponent testing with Vitest
24mWriting Good Tests for Vue Applications
23mSeven ways to make your Vue component tests better
