This project demonstrates the usage of Vitest Framework for Unit testing of Javascript based projects.
As a sample, we have a sumOfTwoNumbers() function which returns the sum of two numbers. The Unit tests are written inside the file 'sum.spec.js'
- Clone the project to your local
- Navigate to the project folder
- Run - npm install, this will download the dependencies already defined in the 'package.json' file, into your node_modules folder.
- Now run the test using the command - npm test.
- This project uses Vitest Framework. More about it can be found at Vitest website
- Vitest has hot reloading enabled, so if you have run the command npm test, you can directly modify your test files on the fly without the need to run the test command again and again.