Created
December 22, 2015 15:41
-
-
Save skeep/07b7f908a206b6bbc9e3 to your computer and use it in GitHub Desktop.
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
'use strict'; | |
var path = require('path'); | |
var gulp = require('gulp'); | |
var conf = require('./conf'); | |
var karma = require('karma'); | |
function runTests(singleRun, done) { | |
var localConfig = { | |
configFile: path.join(__dirname, '/../karma.conf.js'), | |
singleRun: singleRun, | |
autoWatch: !singleRun | |
}; | |
var server = new karma.Server(localConfig, function (failCount) { | |
done(failCount ? new Error("Failed " + failCount + " tests.") : null); | |
}); | |
server.start(); | |
} | |
gulp.task('test', ['scripts:test', 'markups'], function (done) { | |
runTests(true, done); | |
}); | |
gulp.task('test:auto', ['scripts:test-watch'], function (done) { | |
runTests(false, done); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment