Created
March 28, 2018 12:21
-
-
Save szkrd/294e0fb092f2b291ca1a2f1b48f78733 to your computer and use it in GitHub Desktop.
Mocha silent reporter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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