This is a simple express.js app for demonstrating testing and code coverage. Mocha and Supertest are used for unit and integration testing. Istanbul is used for viewing code coverage. Note that this app only focuses on server-side JavaScript testing.
- Node.js - http://nodejs.org
- Grunt.js - run
sudo npm install -g grunt-cli
- Clone the repo
- Install dependencies with
npm install
- Run development server with
grunt
and go here: http://localhost:3000/
- Run all tests:
grunt test
- Run unit tests:
grunt mochaTest:unit
- Run route tests:
grunt mochaTest:route
- Run api tests:
grunt mochaTest:api
Build the code coverage report with grunt coverage
.