mocoverage
All-in-one reporter with test-coverage for mocha, using blanket, and mocha-text-cov.
Configuring
- install the dependencies:
npm install mocha --save-devnpm install blanket --save-devnpm install mocoverage --save-dev
- add the following test line to the
scripts
stanza in your package.json:
- 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.