From bcd0d12abb2f8d663583570d980ebd004e70dd10 Mon Sep 17 00:00:00 2001 From: MariuszTrybus Date: Wed, 3 Sep 2014 23:34:01 +0200 Subject: [PATCH] Add support for --errorout Failed test breaks build (non zero status is returned if --errorout flag is set) --- plugin.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugin.js b/plugin.js index ee635e6..2799b60 100644 --- a/plugin.js +++ b/plugin.js @@ -9,8 +9,13 @@ var registration = function(config, register) { }; var _startKarma = function(config, options, next) { - karma.server.start(config.karma); - next() + karma.server.start(config.karma, function(exitCode){ + if (exitCode) { + config.log.error("Tests failed.", { exitIfBuild: true }); + } + + next(); + }); }; module.exports = {