This repository contains unit testing in javscript using mocha and chai in a simple way to understand about unit testing. This repository contains unit testing use for two different testing, using express (endpoint server) & pure javascript without express
- yarn v1.17+
- NodeJS v8+
- Unit Testing End Point '/' (Check String Response)
- Unit Testing End Point '/user' (Check Member In Array)
- Unit Testing End Point '/users' (Check Member In Array of Object)
- Unit Test Add Function (Two Number)
- Unit Test Async Add Function (Two Number)
- Unit Test Square Function (One Number)
- Unit Test Async Square Function (One Number)
for ( Local Version ) :
- Clone or download this repository
- Install the dependencies by running
yarn install - Make sure you have global installation nodemon in your computer, if not you can install in your project using
yarn add nodemon - Start the code using
yarn test-watching