This repository aims to demonstrate how React Testing Library can be used to automate testing in a frontend application built using React. As a part of a DevOps course DD2482 Automated Software Testing and DevOps, this was developed in collaboration with Julian Nalenz ([email protected], @nalenz).
- Clone this repository
git clone https://github.com/elibon99/react-testing-library-demo.git
cd
into the repository and runnpm install
to install all dependencies.
To run the actual application, execute the following command.
npm start
This will start the web application on your local machine and open up the application in your default web-browser.
To run the tests, execute the following command:
npm test
After running the above command, a menu in the terminal will be displayed in which you can decide to run all the tests. Enter a
to run all tests. This will run all test suites defined in the project (3 in total), and their corresponding test cases (8 in total).