Provides an alternative test runner for Mocha which mutes test contents. Uses mute
to mute streams.
$ npm install --save mocha-mute
var mute = require('mocha-mute');
describe("Noisey module test", function() {
beforeEach(function() {
mute(function() {
console.log("Will not be displayed");
})
});
mute.it("should mute sync tests", function() {
console.log("Will not be displayed");
}
mute.it("should mute async tests with done", function(done) {
setTimeout(function() {
console.log("Will not be displayed");
done();
}, 100);
}
mute.it("should mute async tests with Promise", function() {
return new Promise(function(resolve, reject) {
setTimeout(function() {
console.log("Will not be displayed");
resolve();
}, 100);
});
}
});
Runs a function fn
, muting all output.
Uses the same specification as mocha's it
. Mutes the contents of the test.
Wraps a promise promise
, muting all output during the execution of the promise.
$ npm test
Pull requests are accepted.