Back to Browse

#34 - Unit Testing Components - Vue 3 (Options API) Tutorial

6.3K views
Nov 25, 2022
13:35

In this Vue 3 tutorial, we learn how to test specific Vue features with Jest. We cover testing components and their children, elements in components, computed properties, props and native and custom events. We cover the following topics: 1. Lesson Project 2. How to test a component 3. How to test if elements exist 4. How to find a child component 5. How to test computed properties 6. How to test props 7. How to test native DOM events 8. How to test component events _Note that this tutorial is for the Vue 3 Options API (which is similar to Vue 2). We later move on to the Composition API and then the Script Setup (3.2 update)_ Jest Test Runner https://jestjs.io/ Vue CLI Unit Jest Plugin https://cli.vuejs.org/core-plugins/unit-jest.html Vue Jest https://github.com/vuejs/vue-jest Vue Testing Utilities https://next.vue-test-utils.vuejs.org/ This lesson is also available in written format https://www.koderhq.com/tutorial/vue/unit-test-component/ Check out the Vue 3 for Beginners playlist for more Vue tutorial videos https://www.youtube.com/playlist?list=PLFAU47Id44XG48v5dPPTGMgJfjMnsU8Bw Subscribe to the channel and never miss a lesson https://www.youtube.com/channel/UCz6k9pRLevdJGAsMMAVSb_Q?sub_confirmation=1 Visit the website for a wide range of programming tutorials https://www.koderhq.com

Download

0 formats

No download links available.

#34 - Unit Testing Components - Vue 3 (Options API) Tutorial | NatokHD