In the previous chapter, we examined the role of Babel in modern JavaScript development. We've also seen some practical examples of using it in Vue. In this chapter, we will introduce testing in JS. We will get acquainted with testing in general and see it in practice using Jest and Cypress. We'll discuss assertions and test-driven development (TDD). We'll then move on to understanding how Jest and Cypress work with Vue CLI 3. We'll discuss test utils and test cases. Specifically, we'll look at the following:
- Understanding Vue plugins
- Adding the Jest plugin to our Vue app
- Writing unit tests inside a Vue app with Jest
- Running tasks from the project tasks page
- Running unit tests inside the Vue CLI UI
- Working with assertions
- Implementing TDD
- Working with Cypress
We'll begin this chapter with a brief overview of Vue plugins.
...