FFFF GitHub - dbehmoaras/UnitTestingNodeJSRoute: Unit testing a Node Js web app route. · GitHub
[go: up one dir, main page]

Skip to content

About

Unit testing a Node Js web app route.

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TestingNodeJSRoute

Testing a Node Js express web app route.

Pre-requisites - Node Js - https://nodejs.org, Mocha - npm install mocha --save-dev, supertest - npm install supertest --save-dev, assert - npm install assert --save-dev, expressjs - npm install express --save-dev

Since Node JS does not provide for a web server, express.js is used to fulfill the http needs of a Node web app. But since testing a web app route should happen in an isolated form and not require frequent re-starting of the server, supertest helps by starting the express.js server script and running the mocha tests on it.

Navigate to the test folder. Run "Mocha usertest.js"

About

Unit testing a Node Js web app route.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0