Skip to content

Commit

Permalink
refactor: adds summary to html reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-zakharchenko committed Apr 2, 2019
1 parent a3d103c commit 6aa4874
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/reporters/HTMLReporter.js
Expand Up @@ -44,6 +44,16 @@ HTMLReporter.prototype.configureEmitter = function configureEmitter(emitter) {
});

emitter.on('end', (callback) => {
this.buf += '\n---';
this.buf += `\n${title('Summary')}`;
this.buf += `\n**Tests completed:** ${this.stats.passes} passing,
${this.stats.failures} failing,
${this.stats.errors} errors,
${this.stats.skipped} skipped,
${this.stats.tests} total.
`;
this.buf += `\n\n**Tests took:** ${this.stats.duration}ms.`

const html = md.render(this.buf);
makeDir(pathmodule.dirname(this.path))
.then(() => {
Expand Down

0 comments on commit 6aa4874

Please sign in to comment.