Setting up Cypress in our Angular project
Now that we’ve understood what Cypress is for and its role in an Angular project, we’ll look at how to configure it in our project.
Installing Cypress
To begin, you need to have Node.js and npm installed on your machine. If you don’t have them already, download and install them from the official Node.js website.
Once you have Node.js and npm installed, open your terminal and navigate to your Angular project’s root directory. Run the following command to install Cypress as a dev dependency:
$ npm install cypress --save-dev
The previous command will download and install Cypress in your project. This is how it works in the terminal:
Figure 7.1 – Cypress installation
After installation, you can see the dependency in the package.json file:
Figure 7.2 – Cypress dependency in package.json
In the next section, we’ll look at how...