jeudi 29 octobre 2015

gulp karma test TypeError: Server is not a function

Trying to run karma using gulp for running tests but after following the example from: http://ift.tt/1y16a2M

My gulp file:

var gulp = require('gulp');
var Server = require('karma').Server;

/**
 * Run test once and exit
 */
gulp.task('test', function (done) {
  new Server({
    configFile: __dirname + '/karma.conf.js',
    singleRun: true
  }, done).start();
});

/**
 * Watch for file changes and re-run tests on each change
 */
gulp.task('tdd', function (done) {
  new Server({
    configFile: __dirname + '/karma.conf.js'
  }, done).start();
});

gulp.task('default', ['tdd']);

after I run: gulp test I get the Error:

TypeError: Server is not a function at Gulp.<anonymous>

Any suggestions of what might be wrong?

Aucun commentaire:

Enregistrer un commentaire