Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Javascript Unit Testing (Vitest)

Description

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'

How to run this project

  1. Clone the project to your local
  2. Navigate to the project folder
  3. Run - npm install, this will download the dependencies already defined in the 'package.json' file, into your node_modules folder.
  4. Now run the test using the command - npm test.

Additional Note

  • 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.

About

Sample Unit testing script for Javascript based project using Vitest Framework

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages