code: function XUnitZH(runner) {
   
    var tests = [],
        passes = 0,
        failures = 0;
   
    runner.on('pass', function(test){
      test.state = 'passed';
      passes++;
      tests.push(test);
      test.number = tests.length;
    });
   
    runner.on('fail', function(test){
      test.state = 'failed';
      failures++;
      tests.push(test);
      test.number = tests.length;
    });
   
    runner.on('end', function(){
      console.log();
      console.log('testsuite: Mocha Tests'
                + ', tests: ' + tests.length
                + ', failures: ' + failures
                + ', errors: ' + failures
                + ', skipped: ' + (tests.length - failures - passes)
                + ', time: ' + 0
                );
  
      appendLine(tag('testsuite', {
          name: 'Mocha Tests'
        , tests: tests.length
        , failures: failures
        , errors: failures
        , skipped: tests.length - failures - passes
        , timestamp: (new Date).toUTCString()
        , time: 0
      }, false));
   
      tests.forEach(test);
      appendLine('</testsuite>');
      fs.closeSync(fd);
      process.exit(failures);  
    });
  }
docs: Initialize a new `XUnitZH` reporter.
  
  @param {Runner} runner
  @api public