[Pkg-javascript-commits] [node-tap-mocha-reporter] 07/137: Fix xunit reporter
Bastien Roucariès
rouca at moszumanska.debian.org
Thu Sep 7 09:49:21 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-tap-mocha-reporter.
commit 06efe96204702e67ac307514c38c522156d49996
Author: isaacs <i at izs.me>
Date: Sat Apr 25 09:59:59 2015 -0700
Fix xunit reporter
Requires that the Test objects have a 'state'
---
index.js | 2 +-
lib/reporters/xunit.js | 2 +-
lib/test.js | 3 +++
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/index.js b/index.js
index 39458fa..6c61676 100644
--- a/index.js
+++ b/index.js
@@ -37,7 +37,7 @@ function Formatter (type, options) {
}
var runner = this.runner = new Runner(options)
- this.reporter = new reporters[type](this.runner)
+ this.reporter = new reporters[type](this.runner, {})
Writable.call(this, options)
runner.on('end', function () {
diff --git a/lib/reporters/xunit.js b/lib/reporters/xunit.js
index 77cd347..4380022 100644
--- a/lib/reporters/xunit.js
+++ b/lib/reporters/xunit.js
@@ -57,7 +57,7 @@ function XUnit(runner, options) {
runner.on('end', function(){
self.write(tag('testsuite', {
- name: 'Mocha Tests'
+ name: 'TAP Tests'
, tests: stats.tests
, failures: stats.failures
, errors: stats.failures
diff --git a/lib/test.js b/lib/test.js
index 19ebe42..15d5030 100644
--- a/lib/test.js
+++ b/lib/test.js
@@ -7,6 +7,9 @@ function Test (result, parent) {
this._slow = 75
this.duration = result.time
this.title = result.name
+ this.state = result.ok ? 'pass' : 'failed'
+ this.pending = result.todo || result.skip || false
+
Object.defineProperty(this, 'parent', {
value: parent,
writable: true,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-tap-mocha-reporter.git
More information about the Pkg-javascript-commits
mailing list