Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
NOAH.test = (function(options) {
// Options
var callback = options.callback || process.exit;
var singlerun = (options.singlerun !== 'undefined') ? options.singlerun : true;
karma.start({
frameworks: [
'mocha',
'chai',
'sinon-chai'
],
plugins: [
'karma-chai-plugins',
'karma-mocha',
'karma-mocha-reporter',
'karma-phantomjs-launcher'
],
files: options.files,
gulp.task('unit', function(callback) {
return KarmaServer.start(config.karma, function(exitStatus) {
if (exitStatus) {
throw 'Unit testing failed';
} else {
callback(exitStatus);
}
});
});
function runKarma(configFile, done) {
var karma = require('karma').Server;
var path = require('path');
karma.start({
configFile: path.join(__dirname, configFile)
}, function(e) {
return done(e);
});
}
gulp.task('test', function (done) {
Server.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, function () {
done();
});
});
gulp.task('test', function (done) {
karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done);
});
gulp.task('karma', function(done) {
karma.start({
configFile: __dirname + '/karma.config.js',
singleRun: true
}, function() {
done();
});
});
function karmaTest(done) {
karma.start({
configFile: __dirname + '/karma.conf.js',
}, function () {
done();
});
}
gulp.task("test-once", function(done) {
Server.start(
{
configFile: __dirname + "/karma.conf.js",
singleRun: true,
reporters: ["mocha"]
},
function(error) {
done(error);
}
);
});
gulp.task('karma', function (done) {
karma.start({
configFile: __dirname + '/karma.config.js',
singleRun: true
}, function () {
done();
});
});
function startTests(singleRun, done) {
var Server = require('karma').Server;
var excludeFiles = [];
var server = Server.start({
configFile: __dirname + '/karma.conf.js',
exclude: excludeFiles,
singleRun: !!singleRun
}, karmaCompleted);
function karmaCompleted(karmaResult) {
var status = karmaResult === 1 ? 'ERROR' : 'SUCCESS';
log('karma completed with status: ' + status);
done();
}
}