nyc branches coverage showing 100 (0/0) or 50 (3/6)

36 views Asked by At

The Nyc branch coverage seems to be a bit off to me. I think it is giving me wrong branch coverages.The value and the tests dont seem to be valid to me. We recently upgrade our legacy app from istanbul to nyc. Istanbul had much more valid coverage listed.

Our app is using Node 18.17.0 (cannot downgrade - only option is to upgrade) Nyc - 15.1.0, corresponding mocha => 10.2.0, sinon => 1.17.3 (Since we use sinon stubs)

Our "npm run test" scripts is "test": "nyc node_modules/.bin/mocha -- -u bdd -R spec test/server//.js --exit",

nyc.config.js { "all": true, "include": ["test/server/controllers/.js","test/server/services/.js","test/server/utils/**.js"], "exclude":["test/server/index","test/server/coverage/lcov-report", "target", "server"], "reporter":["html", "cobertura", "text", "text-summary"], "check-coverage": true, "report-dir":"./target/coverage" }

What am I supposed to do on this to have the correct branch coverage ?

I am also attaching the istanbul test report enter image description here This one is Istanbul Coverage report Istanbul test coverage enter image description here This one is Nyc test Coverage report Nyc test coverage

0

There are 0 answers