Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Updated xunit reporter so that an errors attribute is emitted. Changed classname to report the test's parent's title to avoid repetition

David Henderson3a0063a5eaf5
diff --git a/lib/reporters/xunit.js b/lib/reporters/xunit.js
index e033793e..8ee59931 100644
--- a/lib/reporters/xunit.js
+++ b/lib/reporters/xunit.js
@@ -35,6 +35,7 @@ function XUnit(runner) {
name: 'Mocha Tests'
, tests: stats.tests
, failures: stats.failures
+ , errors: stats.failures
, skip: stats.tests - stats.failures - stats.passes
, timestamp: (new Date).toUTCString()
, time: stats.duration / 1000
@@ -57,7 +58,7 @@ XUnit.prototype.__proto__ = Base.prototype;
function test(test) {
var attrs = {
- classname: test.fullTitle()
+ classname: test.parent.fullTitle()
, name: test.title
, time: test.duration / 1000
};