Writing · 2015 · 1 min

Simple Karma Task for Gulp

The other day I could not find an acceptable Karma task for Gulp, so I spent some time on my own. Using Karma ~1.3.0 and Gulp ~3.9.0.

process.exit will stop the task, preventing weird error messages from Gulp. I think Karma calls the complete method for each test file? I don’t know, either way it makes the two dance well together.

One more thing, just a warning do not refactor the last task to match.

var karmaServer = new karma.Server({
    configFile: __dirname + '/test/karma.conf.js'
}, done).start();

There is an integration problem where Gulp will try to read the arguments sent into the done() method. More about this pestering issue here.

Comments

No comments yet. Be the first.

Leave a comment

Plain text. Comments are reviewed before they appear; your email is never asked for.