Skip to content

Instantly share code, notes, and snippets.

@szkrd
Created March 28, 2018 12:21
Show Gist options
  • Save szkrd/294e0fb092f2b291ca1a2f1b48f78733 to your computer and use it in GitHub Desktop.
Save szkrd/294e0fb092f2b291ca1a2f1b48f78733 to your computer and use it in GitHub Desktop.
Mocha silent reporter.
/* eslint no-console:0, no-proto:0 */
const Base = require('mocha/lib/reporters/base');
function Min (runner) {
Base.call(this, runner);
let failed = false;
runner.on('fail', () => {
failed = true;
});
runner.on('end', () => console.log(`Tests ${failed ? 'failed' : 'passed'}.\n`));
}
Min.prototype.__proto__ = Base.prototype;
exports = module.exports = Min;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment