This project focuses on applying unit testing to various functions, including simple ones like addition and sorting, as well as more complex functions like asynchronous calls. The aim was to thoroughly test these functions, including boundary cases, using a unit testing framework called Vitest. This README provides an overview of the project, its purpose, how to run the tests, and other relevant information.
The primary goal of this project is to demonstrate the application of unit testing to a variety of functions commonly found in software development. By testing these functions rigorously, including edge cases, we ensure their reliability and robustness, contributing to overall code quality and reducing the likelihood of bugs.
- Unit tests for simple functions:
- Add function
- Sort function
- Uppercase function
- Unit tests for complex functions:
- Boundary interval function
- Asynchronous call function
To run the unit tests in this project, follow these steps:
-
Clone the Repository:
git clone https://github.com/louaybadri/VitestTastic.git
-
Install Dependencies:
npm install
-
Run Tests:
npm test
This command will execute all the unit tests and display the results, including code coverage statistics provided by Vitest.
Vitest provides detailed code coverage statistics, allowing us to assess the thoroughness of our tests. After running the tests, you can view the coverage report to identify areas that may need additional testing.