https://github.com/devbridie/mocha-mute
Provides an alternative test runner for Mocha which mutes test contents. Uses mute to mute streams.
https://github.com/devbridie/mocha-mute
Last synced: 5 months ago
JSON representation
Provides an alternative test runner for Mocha which mutes test contents. Uses mute to mute streams.
- Host: GitHub
- URL: https://github.com/devbridie/mocha-mute
- Owner: devbridie
- Created: 2017-06-06T14:02:38.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-06T23:52:55.000Z (about 9 years ago)
- Last Synced: 2025-09-25T14:17:18.108Z (9 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/mocha-mute
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `mocha-mute`
[![NPM version][npm-img]][npm-url] [![Downloads][downloads-img]][npm-url]
Provides an alternative test runner for Mocha which mutes test contents. Uses [`mute`](https://www.npmjs.com/package/mute) to mute streams.
## Install
```
$ npm install --save mocha-mute
```
## Usage
```js
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);
});
}
});
```
## API
### `(fn): void`
Runs a function `fn`, muting all output.
### `it(...): void`
Uses the same specification as mocha's `it`. Mutes the contents of the test.
### `promise(promise): Promise`
Wraps a promise `promise`, muting all output during the execution of the promise.
## Test
```
$ npm test
```
## Contribute
Pull requests are accepted.
----
[downloads-img]: http://img.shields.io/npm/dm/mocha-mute.svg?style=flat-square
[npm-img]: http://img.shields.io/npm/v/mocha-mute.svg?style=flat-square
[npm-url]: https://npmjs.org/package/mocha-mute