Original code from vueschool/testing-vue-components
Learn how to test your Vue.js components like a pro with Jest and the official unit testing library for Vue.js - Vue Test Utils
In this course, you’ll learn everything you need to know to write proper unit tests for your Vue components.
Not sure how to mount and render your component to perform assertions. Not sure what you should and shouldn't test? Or how to test a specific thing? This course is for you!
By the end of this testing course you will know
- Which tools are required for an efficient testing workflow
- How to mount and render your Vue components
- How to programmatically interact with your components through Vue Test Utils
- How to test computed properties and watchers
- How to test Vue.js lifecycle methods
- How to traverse the DOM and test …
- How to stub child components
- How to test that a Vuex Store is injected properly
You need a basic understanding of testing in JavaScript and Jest. We recommend watching JavaScript Testing Fundamentals and Test with Jest if you're not already familiar with the topics.