Open remcohaszing opened 8 years ago
aim of karma-remap-coverage
reporter is just to remap coverage to original files
it's based on karma-coverage
so you are free to configure coverage checks, for example:
coverageReporter: {
check: {
global: {
lines: 80
}
},
type: 'in-memory'
},
remapCoverageReporter: {
html: './coverage/html'
}
@sshev Do these coverage checks actually work for you? I have set checks like this:
coverageReporter: {
type: 'in-memory',
check: {
global: {
statements: 50,
branches: 50,
functions: 50,
lines: 80
}
}
}
But my build does not fail, having branches
coverage less than 50% thought.
I debugged karma-coverage
until
https://github.com/karma-runner/karma-coverage/blob/master/lib/reporter.js#L168
and noticed, the actual
value is not the value i am getting in the coverage report.
I think thats the value before any remap is done, isn't it?
So as it is, you cannot use the coverage checks. Would you mind looking into that again :) ?
@maffelbaffel it strongly seems I have the same situation. Files without branches error saying only 50% is hit, but other reports show 0/0 branches with a 100% result.
karma-coverage
allows to specify some coverage checks, so karma fails if the minimal coverage isn't achieved.Could you implement that for this plugin as well?