Last active
November 15, 2015 00:15
-
-
Save bendangelo/8c83911268902bf85f0c to your computer and use it in GitHub Desktop.
Karma Gulp Task. Karma version 1.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Run test once and exit | |
| */ | |
| gulp.task('test', function (done) { | |
| var karmaServer = new karma.Server({ | |
| configFile: __dirname + '/test/karma.conf.js', | |
| singleRun: true | |
| }, function (exitCode) { | |
| done(); | |
| process.exit(exitCode); | |
| }).start(); | |
| }); | |
| /** | |
| * Run tests in chrome browser | |
| */ | |
| gulp.task('test:chrome', function (done) { | |
| var karmaServer = new karma.Server({ | |
| configFile: __dirname + '/test/karma.conf.js', | |
| browsers: ['Chrome'] | |
| }, function (exitCode) { | |
| done(); | |
| process.exit(exitCode); | |
| }).start(); | |
| }); | |
| /** | |
| * Watch for file changes and re-run tests on each change | |
| */ | |
| gulp.task('tdd', function (done) { | |
| var karmaServer = new karma.Server({ | |
| configFile: __dirname + '/test/karma.conf.js' | |
| }, function () { | |
| done(); | |
| }).start(); | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment