cobertura-diff-coverage
v1.0.12
Published
Compares the cobertura.xml file with a diff patch and verify the coverage percentage for changed code
Downloads
179
Maintainers
Readme
cobertura-diff-coverage
Requirements
- Add
cobertura
as coverage reporter to jest configuration - Run git diff command prior to plugin execution:
git diff refs/remotes/origin/master...HEAD > diff.patch
Add the command to package.json
"scripts": {
"cdc": "cdc"
},
Configure ci/cd:
- Make sure your feature branch generate the cobertura.xml file using the coverage reporter "cobertura"
- Run git diff command "git diff refs/remotes/origin/master...HEAD > diff.patch"
- Run cdc command
- Catch exit codes of cdc, 0 = coverage check passed, 1 = coverage check failed