gulp-modular-karma
Modular extension to run unit tests in a gulp-modular project.
Installation
npm install gulp-modular-karma
bower install angular-mocks
Karma configuration
Copy default.karma.conf.js
in your project root and name it karma.conf.js
.
Integration in gulpfile
var gulp = ;var gulpModularKarma = ; // optionally overwrite default configurationvar config = //// task [`karma`] performs unit tests on project karma: // src : './karma.conf.js', // karma configuration file to use // browsers: ['PhantomJS', 'Firefox', 'Chrome'] // all browser to run tests in (only for `test:all`) ; ;
Usage
Run gulp karma
to execute the tests once.
Run gulp karma:watch
to execute the tests whenever a file changes.
Run gulp karma:all
to run the tests in all defined browers.
Run gulp test
, gulp test:watch
or gulp test:all
to build the project before the related karma
task is run.