A simple, well-tested todo app
Install the grunt-cli
module globally:
npm install -g grunt-cli
Install dependencies:
npm install
To build and run tests once:
grunt build test
To build, then watch for changes and run tests accordingly:
grunt
Jasmine is used for client-side unit testing.
Karma is used to run unit tests client-side in real browsers.
The following Karma plugins are used:
- karma-coverage - Build coverage reports with Istanbul
- karma-jasmine - Allow unit tests to be written with Jasmine
- karma-chrome-launcher - Launch Chrome for testing
- karma-firefox-launcher - Launch Firefox for testing
Istanbul generates code coverage reports for client-side unit tests.
CasperJS is used to run client-side end-to-end tests in a headless browser.
PhantomCSS is used to run visual regression tests in a headless browser.
Grunt is used to perform build tasks and kick of testing operations, as well as watch files for changes and test accordingly.
The following Grunt plugins are used:
- grunt-karma - Start Karma from Grunt
- grunt-casperjs - Start CasperJS from Grunt
- grunt-phantomcss - Start PhantomCSS from Grunt
- grunt-express-server - Start a server for CasperJS and PhantomCSS testing
- grunt-contrib-jshint - Check for JavaScript errors before running tests
- grunt-contrib-watch - Watch files for changes and run tasks accordingly
- grunt-karma-coveralls - Submit code coverage reports to Coveralls
TravisCI is used to run tests when commits are pushed or pull requests are submitted.
See GUI & Headless browser testing with Travis for information on setting up Travis for headless testing.
Coveralls is used to track code coverage over time. After tests run on TravisCI, the code coverage report is submitted to Coveralls.