karma-istanbuljs-reporter
a Karma plugin for generate code coverage using new, v1, Istanbul API
This reporter try to mimic behaviours and settings of nyc tool more than karma-coverage
Instrumentation
Use babel-istanbul-plugin for source instrumentation. Don´t forget exclude
test files from instrumentation using exclude/include
rules
Installation
npm
npm install karma-istanbuljs-reporter --save-dev
Usage
Add karma.conf.js
file to project.
karma.conf.js
Examples of Basic
module { config;}
Multiple reporters
module { config;}
istanbul-reports
Supported reportersChecking coverage
karma-istanbuljs-reporter
can fail tests if coverage falls below a threshold.
module { config;}
thresholds
Default lines: 90 functions: 0 statements: 0 branches: 0
Checking coverage with custom thresholds
module { config
WIP: 'Include all sources' feature
Example
Contributing
- Documentation improvement
- Feel free to send any PR