karma-mocha-reporter
Advanced tools
Comparing version 0.2.3 to 0.2.4
15
index.js
@@ -11,3 +11,3 @@ 'use strict'; | ||
*/ | ||
var MochaReporter = function (baseReporterDecorator, config) { | ||
var MochaReporter = function (baseReporterDecorator, formatError, config) { | ||
// extend the base reporter | ||
@@ -147,6 +147,9 @@ baseReporterDecorator(this); | ||
// add all browser in which the test failed with color yellow | ||
line += repeatString(' ', depth + 1) + chalk.italic.yellow(item.failed.join('\n' + repeatString(' ', depth + 1))) + '\n'; | ||
for(var bi = 0; bi < item.failed.length; bi++) { | ||
var browserName = item.failed[bi]; | ||
line += repeatString(' ', depth + 1) + chalk.italic.yellow(browserName) + '\n'; | ||
} | ||
// add the error log in red | ||
line += repeatString(' ', depth) + chalk.red((item.log || [])[0]) + '\n'; | ||
line += chalk.red(formatError((item.log||[])[0], repeatString(' ',depth))); | ||
} | ||
@@ -184,3 +187,3 @@ | ||
item.skipped = result.skipped; | ||
item.success = item.success === undefined ? true : item.success && result.success; | ||
item.success = (item.success === undefined ? true : item.success) && result.success; | ||
@@ -276,3 +279,3 @@ // it block | ||
// inject karma runner baseReporter and config | ||
MochaReporter.$inject = ['baseReporterDecorator', 'config']; | ||
MochaReporter.$inject = ['baseReporterDecorator', 'formatError', 'config']; | ||
@@ -282,2 +285,2 @@ // PUBLISH DI MODULE | ||
'reporter:mocha': ['type', MochaReporter] | ||
}; | ||
}; |
{ | ||
"name": "karma-mocha-reporter", | ||
"description": "Karma reporter with mocha style logging.", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"homepage": "http://www.litixsoft.de/modules-karmamochareporter", | ||
@@ -17,2 +17,5 @@ "author": "Litixsoft GmbH <info@litixsoft.de> (http://www.litixsoft.de)", | ||
], | ||
"contributors": [ | ||
"Artem Baguinski <abaguinski@gmail.com>" | ||
], | ||
"repository": { | ||
@@ -48,3 +51,3 @@ "type": "git", | ||
"grunt-contrib-jshint": "^0.10.0", | ||
"grunt-karma": "^0.8.2", | ||
"grunt-karma": "^0.8.3", | ||
"karma-detect-browsers": "^0.1.2", | ||
@@ -51,0 +54,0 @@ "karma-jasmine": "^0.1.5" |
@@ -53,2 +53,7 @@ # karma-mocha-reporter | ||
## Release History | ||
### v0.2.4 | ||
* better browser names formatting | ||
* fix calculating describe items' success | ||
* use karma's error formatter | ||
### v0.2.3 | ||
@@ -55,0 +60,0 @@ * fix missing test results when singleRun = true |
14575
232
96