UNPKG

mocha-suppress-logs

Version:

Suppress console output of successful mocha tests.

18 lines (14 loc) 284 B
'use strict'; const logCapture = require('./lib/log-capture'); exports.mochaHooks = { beforeEach() { logCapture.start(); }, afterEach() { logCapture.stop(); if (this.currentTest.state === 'failed') { logCapture.print(); } logCapture.reset(); } };