Introduction

TDD (Test Driven Approach) in node js. TDD by using mocha and chai.

Mocha

Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun.
https://mochajs.org/

Chai

Chai is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework.
https://www.chaijs.com/

Installation

npm install
yarn install

DB Setup

use mongodb so go to mongodb create the cluster and get the url from connection and add in .env file.
DB_URL = "****"

Run Test

npm run test

Run server

nodemon 
node server