Skip to content

Commit

Permalink
Fix xunit reporter
Browse files Browse the repository at this point in the history
Requires that the Test objects have a 'state'
  • Loading branch information
isaacs committed Apr 25, 2015
1 parent 5d8892e commit 06efe96
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
2 changes: 1 addition & 1 deletion lib/reporters/xunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 06efe96

Please sign in to comment.