javascript - grunt-code-coverage-enforcer doesn't fail on threshhold limits -
i'm running jasmine tests , karma coverage generate lcov file. can see in coverage reports , console there poor line coverage on number of javascript files.
------------------------------------|-----------|-----------|-----------|-----------| file | % stmts |% branches | % funcs | % lines | ------------------------------------|-----------|-----------|-----------|-----------| ./src/accountdetails/controller\ | 9.09 | 100 | 0 | 9.09 | accountdetailscontroller.js | 9.09 | 100 | 0 | 9.09 |
istanbul isn't stopping grunt process, added grunt-code-coverage-enforcer. configuration looks this:
'code-coverage-enforcer': { /* doesn't seem work either */ options: { lcovfile: "build/lcov/phantomjs 1.9.7 (windows 7)/lcov.info", lines: 99, functions: 99, branches: 99, src: "src", includes: ['src/**/*.js'], excludes: [] } }
i'm pretty sure enforcer running, because wasn't finding lcov.info file. if run enforcer task --verbose, see (removed lot of extraneous stuff, reiterates input options, correct):
reading lcov file .... processing file:build/lcov/phantomjs 1.9.7 (windows 7)/lcov.info checking if file exists ... build/lcov/phantomjs 1.9.7 (windows 7)/lcov.info processing callback [ { "file": "./src/accountdetails/controller/accountdetailscontroller.js", "lines": { "found": 11, "hit": 1 }, "functions": { "hit": 0, "found": 3 }, "branches": { "hit": 0, "found": 0 } } ] ------------------------------------------------------------------ scanning folder files ------------------------------------------------------------------ collecting directory:src\accountdetails\controller ------------------------------------------------------------------ threshold configuration: lines:99%, functions:99%, branches:99% ------------------------------------------------------------------ file:./src/accountdetails/controller/accountdetailscontroller.js lines:9.09% | functions:100% | branches:100% | >> excluded done, without errors.
so questions are:
- is correct?
- what >> excluded in output about?
- is enforcer task supposed fail build process?
- can make fail build process (or misinterpreting code coverage enforcement in javascript app for) ????????????
i submitted pull request @ https://github.com/tapasvimoturu/grunt-code-coverage-enforcer/pull/2 should fix this. author accept request , republish project npm.
Comments
Post a Comment