New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mocha-mute

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-mute

Provides a wrapper for muting mocha tests.

latest
Source
npmnpm
Version
1.1.2
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

mocha-mute

NPM version Downloads

Provides an alternative test runner for Mocha which mutes test contents. Uses mute to mute streams.

Install

$ npm install --save mocha-mute

Usage

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.

Keywords

mocha

FAQs

Package last updated on 06 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts