index.js
function (data) {
    var body = '';
    var contents = '';
    var tests = '';
    var banner = '';

    // add test results
    var keys = Object.keys(this.output.test);
    keys.forEach(function (key) {
      tests += this.output.test[key];
    }.bind(this));

    // compile the test result template
    body = this.templates.testresult({result: data, tests: tests});

    // compile the banner
    banner = this.templates.banner({status: data.status});

    // compile the contents within the wrapper template
    contents = this.templates.wrapper({styles: this.styles, js: this.js, banner: banner, body: body});

    // save the main test output file
    this.events.emit('report:written', {type: 'html', dest: this.dest});
    this._recursiveMakeDirSync(this.dest + '/details');
    fs.writeFileSync(this.dest + '/index.html', contents, 'utf8');
    return this;
  }
function (data) {
    var body = '';
    var contents = '';
    var tests = '';
    var banner = '';

    // add test results
    var keys = Object.keys(this.output.test);
    keys.forEach(function (key) {
      tests += this.output.test[key];
    }.bind(this));

    // compile the test result template
    body = this.templates.testresult({result: data, tests: tests});

    // compile the banner
    banner = this.templates.banner({status: data.status});

    // compile the contents within the wrapper template
    contents = this.templates.wrapper({styles: this.styles, js: this.js, banner: banner, body: body});

    // save the main test output file
    this.events.emit('report:written', {type: 'html', dest: this.dest});
    this._recursiveMakeDirSync(this.dest + '/details');
    fs.writeFileSync(this.dest + '/index.html', contents, 'utf8');
    return this;
  }
function ( data ) { var body = '' ; var contents = '' ; var tests = '' ; var banner = '' ; // add test results var keys = Object . keys ( this . output . test ) ; keys . forEach ( function ( key ) { tests += this . output . test [ key ] ; } . bind ( this ) ) ; // compile the test result template body = this . templates . testresult ( { result : data , tests : tests } ) ; // compile the banner banner = this . templates . banner ( { status : data . status } ) ; // compile the contents within the wrapper template contents = this . templates . wrapper ( { styles : this . styles , js : this . js , banner : banner , body : body } ) ; // save the main test output file this . events . emit ( 'report:written' , { type : 'html' , dest : this . dest } ) ; this . _recursiveMakeDirSync ( this . dest + '/details' ) ; fs . writeFileSync ( this . dest + '/index.html' , contents , 'utf8' ) ; return this ; }
Writes the index page to the filesystem

@method outputRunnerFinished
@param {object} data Event data
@chainable
Writes the index page to the filesystem