Questions tagged [nyc]

a command-line interface for the Istanbul code coverage tool.

nyc is a command-line interface for the Istanbul code coverage tool.

147 questions
0
votes
0 answers

How to obtain Cypress code coverage report if tests are launched vs production build compiled in tomcat (Java)?

I'm currently working in obtain the code coverage report from my Cypress tests, to do so I use nyc istambul to instrument the code and code-coverage plugin to obtain the report. Take in account that our program works with react-app-rewired and has a…
André
  • 1
  • 1
0
votes
0 answers

Incorrect code coverage using nyc with Jest Based E2E Test Framework

I am trying to generate code coverage for the single e2e test case. Here is what I did to achieve this. Instrumented files related to e2e test case using nyc. Note here I used in place instrumentation Executed test cases. stored coverage report…
rajender kumar
  • 412
  • 3
  • 12
0
votes
1 answer

npm run coverage fails with "require(...).internalModuleStat is not a function"

When we run our tests with npm run test, they pass. When we run with npm run coverage, though, some fail with this error: 'internal/modules/cjs/loader.js:58\n' + "const internalModuleStat = function (f) { return…
brandizzi
  • 26,083
  • 8
  • 103
  • 158
0
votes
1 answer

Minimalistic nyc (istanbul) javascript coverage not working for es-modules (ESM)

Trying to figure out why I get no coverage out of nyc whatsovever, I ended up with a file single file ./x.js that only contains #!/usr/bin/env node 'use strict' console.log('======= starting tests ======='); In package.json I have ... …
Harald
  • 4,575
  • 5
  • 33
  • 72
0
votes
1 answer

Istanbul Code Coverage tool incredibly slow after updating from version 12 to version 14

We use the Istanbul code coverage tool with Mocha to execute our Javascript unit tests. This has been working fairly well for quite some time. But, we were using version 12.0 with Node 11. We are trying to update our build system to Node 14, and…
Kevin Hirst
  • 876
  • 8
  • 17
0
votes
1 answer

How to meet the test coverage in the following Unit testing in Nodejs?

I am doing Unit testing in NodeJS. I have managed to see the coverage of my unit testing using NYC. I would like to know how can i widen my unit testing scope to increase the coverage of Statement branch and condition branch. I have the following…
Smile Kisan
  • 191
  • 4
  • 19
0
votes
0 answers

Code coverage of angular application using external test suite

I have an Angular application (v10) which is being tested using manual and selenium based automated suite. I have no unit tests or e2e tests, only external testing is available. I would like to have code coverage of my…
Pierre
  • 1,329
  • 2
  • 12
  • 21
0
votes
1 answer

The test project(mocha+axios+chai) is independent, how to count the server code coverage

There are two projects now. Test project A uses mocha + axios + chai, and the Server project uses node express. Now I want to count how much coverage can be achieved by Server project B when running test project A Project A(Testing Project) import…
Justin
  • 1
  • 2
0
votes
0 answers

NYC mocha covering all files in my nodejs code except functions

I just run a test using NYC mocha on my nodejs repo, and I got a total coverage of 23.57%, config and models are 100% covered but controllers had only 19% covered, turned out it's only covering the declaration of variables but not functions (I got…
devSecRoot
  • 13
  • 5
0
votes
0 answers

Cypress nyc code coverage is not instrumenting the code

I am trying to introduce e2e code coverage in my react app. I can see hash-file.json is getting created in .nyc_output below are my package.json scripts { "start": "npm run clean && cross-env NODE_ENV=test node ./tools/devServer.js", …
anujayk
  • 544
  • 7
  • 31
0
votes
1 answer

How to use mochawesome and mocha-sonarqube-report in a single command?

I have the following script in my package.json file to check the code coverage of the UT: "coverage": "nyc --reporter=lcov --reporter=cobertura mocha ./test/apis_new/* --reporter mocha-sonarqube-reporter --reporter-options output=xunit.xml mocha…
Shrabanee
  • 2,706
  • 1
  • 18
  • 30
0
votes
1 answer

How to remove sections of lcov-report completely using nyc?

*I'm using the @cypress/code-coverage plugin. I have tried to include only the directory I want: { "extends": "@istanbuljs/nyc-config-typescript", "all": true, "report-dir": "cypress-coverage", "reporter": ["text-summary", "lcov"], …
jameseg
  • 730
  • 1
  • 4
  • 19
0
votes
0 answers

code coverage with nyc returning 0% for lines, statement and functions

I'm using nodeJS and have created unit tests using sinon,chai along with code coverage nyc. but nyc is returning 0% for statements, lines, functions - ======================== Coverage summary =============================== Statements : 0% ( 0/34…
0
votes
1 answer

nyc report fails with ENOENT when run through Cypress code-coverage plugin in CircleCI

I'm using the Cypress code-coverage and instrument-cra plugins. This works just fine when run locally on my own machine, but when run through CircleCI I get: CypressError: cy.task('coverageReport') failed with the following error: > Error: Command…
magjac
  • 857
  • 1
  • 8
  • 12
0
votes
0 answers

how would i ignore a folder for being included into (coveralls) while running unit testing with mocha chai coveralls

hi I am trying to exclude given from being added into the coverall of my tests the following my test command "test": "nyc --reporter=html --reporter=text mocha --timeout 10000 --require @babel/register \"./{,!(node_modules)/**/}*.test.js\"…
1 2 3
9
10