lib/mocha.js
function XUnit(runner) {
  Base.call(this, runner);
  var stats = this.stats
    , tests = []
    , self = this;

  runner.on('pass', function(test){
    tests.push(test);
  });
  
  runner.on('fail', function(test){
    tests.push(test);
  });

  runner.on('end', function(){
    console.log(tag('testsuite', {
        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
    }, false));

    tests.forEach(test);
    console.log('</testsuite>');    
  });
}
function XUnit(runner) {
  Base.call(this, runner);
  var stats = this.stats
    , tests = []
    , self = this;

  runner.on('pass', function(test){
    tests.push(test);
  });
  
  runner.on('fail', function(test){
    tests.push(test);
  });

  runner.on('end', function(){
    console.log(tag('testsuite', {
        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
    }, false));

    tests.forEach(test);
    console.log('</testsuite>');    
  });
}
function XUnit ( runner ) { Base . call ( this , runner ) ; var stats = this . stats , tests = [ ] , self = this ; runner . on ( 'pass' , function ( test ) { tests . push ( test ) ; } ) ; runner . on ( 'fail' , function ( test ) { tests . push ( test ) ; } ) ; runner . on ( 'end' , function ( ) { console . log ( tag ( 'testsuite' , { 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 } , false ) ) ; tests . forEach ( test ) ; console . log ( '</testsuite>' ) ; } ) ; }
Initialize a new `XUnit` reporter.

@param {Runner} runner
@api public
Initialize a new XUnit reporter .