Our base example application
It is best to understand the discipline of testing and learn about the tools by applying them to a real project through practice. As a learning exercise, we will first take a running application based on one of the examples presented in Chapter 2, Software Design Principles and Patterns. We will build a Fibonacci calculator and install the Vitest test suite and Vue Testing Utils to the project. Later, we will explain what would change in this approach when applying the TDD discipline.
The code for this application can be found in the repository for this chapter. Once downloaded, you need to execute the following command to install the dependencies:
$ npm install
Then, to run the application, you must run the following:
$ npm run start
When the server is ready, loading the site in your web browser should present you with an application like this:
Figure 9.1 – The example application with a Fibonacci calculator...