Skip to content

Instantly share code, notes, and snippets.

@skeep
Created December 22, 2015 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skeep/07b7f908a206b6bbc9e3 to your computer and use it in GitHub Desktop.
Save skeep/07b7f908a206b6bbc9e3 to your computer and use it in GitHub Desktop.
'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