Socket
Book a DemoInstallSign in
Socket

mocoverage

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocoverage

a mocha reporter with coverage using blanket.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

mocoverage

All-in-one reporter with test-coverage for mocha, using blanket, and mocha-text-cov.

Configuring

  • install the dependencies:
npm install mocha --save-dev
npm install blanket --save-dev
npm install mocoverage --save-dev
  • add the following test line to the scripts stanza in your package.json:
  {
    "scripts": {
      "test": "mocha --check-leaks --ui exports --require blanket -R mocoverage"
    }
  }
  • add configuration for blanket and mocoverage:
{
  "config": {
    "blanket": {
      "pattern": "lib",
      "data-cover-never": [
        "node_modules",
        "test"
      ],
      "output-reporter": "spec"
    }
  }
}

The important parts:

  • output-reporter: is the reporter that mocha will use for test output, in this case the output is in spec format.
  • pattern: is the pattern used to match files that coverage should be applied to.

Keywords

mocha

FAQs

Package last updated on 17 Jan 2015

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