Chapter 2. Creating your first test

This chapter covers

  • Writing npm scripts
  • Catching formatting errors with ESLint
  • Writing unit tests with Jest
  • Writing unit tests for Vue components with Vue Test Utils
  • Debugging Jest tests with the Chrome Debugger

A journey of a thousand miles begins with a single step, and every great test suite begins with a single test. This chapter is about writing that first test. By the end of the chapter you will have a test script that checks the project for formatting errors and runs a unit test against a Vue component.

To follow along with this chapter you need to install the correct programs and set up your environment. You can find the installation and setup instructions in appendix A. Follow the instructions to ...

Get Testing Vue.js Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.