Skip to content

armgit / mocha

Public Imported from GitHub
0

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

cleaning up xunit reporter some more

TJ Holowaychuk2d957573a645
diff --git a/lib/reporters/xunit.js b/lib/reporters/xunit.js
index 17db235a..d913873d 100644
--- a/lib/reporters/xunit.js
+++ b/lib/reporters/xunit.js
@@ -26,21 +26,20 @@ function XUnit(runner) {
, tests = []
, self = this;
- runner.on('test end', function(test) {
+ runner.on('test end', function(test){
tests.push(test);
});
- runner.on('end', function() {
+ runner.on('end', function(){
console.error(tag('testsuite', {
- name: 'Mocha Tests',
- tests: stats.tests,
- failures: stats.failures,
- skip: (stats.tests - stats.failures - stats.passes),
- timestamp: (new Date).toUTCString(),
- time: stats.duration / 1000.0
+ name: 'Mocha Tests'
+ , tests: stats.tests
+ , failures: stats.failures
+ , skip: stats.tests - stats.failures - stats.passes
+ , timestamp: (new Date).toUTCString()
+ , time: stats.duration / 1000
}, false));
-
tests.forEach(test);
console.error('</testsuite>');
});