https://github.com/ronapelbaum/karma-coverage-incremental
a karma-coverage plugin for incremental coverage
https://github.com/ronapelbaum/karma-coverage-incremental
javascript karma-coverage
Last synced: about 1 year ago
JSON representation
a karma-coverage plugin for incremental coverage
- Host: GitHub
- URL: https://github.com/ronapelbaum/karma-coverage-incremental
- Owner: ronapelbaum
- License: mit
- Created: 2017-04-24T13:16:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-10-21T22:09:26.000Z (over 6 years ago)
- Last Synced: 2025-03-24T11:41:44.480Z (about 1 year ago)
- Topics: javascript, karma-coverage
- Language: JavaScript
- Homepage:
- Size: 55.7 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
karma-coverage-incremental
===
[](https://badge.fury.io/js/karma-coverage-incremental)
[](https://travis-ci.org/ronapelbaum/karma-coverage-incremental)
[](https://coveralls.io/github/ronapelbaum/karma-coverage-incremental?branch=master)
A karma-coverage plugin for incremental coverage
# Usage
```
npm install --save-dev karma-coverage-incremental
```
## Karma (JSON support)
#### install `karma-coverage`
```
npm i -D karma-coverage
```
#### config `karma-coverage`
- Outsource threshold in a separate json file
- Use `json-summary` coverage-reporter
```javascript
coverageReporter: {
check: {
global: require('./coverage.conf.json')
}
reporters: [
{type: 'json-summary'}
]
}
```
#### add `increment`
Add `increment` to reporters:
```javascript
reporters: ['coverage', 'increment']
```
#### config `increment`
```javascript
incrementConfig: {
flexibility: 0.5, //factor to reduce the roughness of the latest coverage results
coverageCheckPath: './coverage.conf.json' //path to coverage threshold json
}
```
#### How does it work?
Takes the latest coverage report (from `json-summary` plugin) and smart-copies it to the `coverage.conf.json` file.
## Node
(in progress...)
## Istanbul (YAML support)
(in progress...)
# Development
```
npm install
npm test
npm run lint
npm run lint-fix
```