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 exclude a file from coverage report in Mocha and Nyc

I have a test setup configured with Mocha and nyc. I'm trying to exclude a certain file from the report. So I tried this: "nyc": { "exclude": [ "./sites/modules/carousel-widget/", ] }, And it actually seems to works because the…
ABGR
  • 4,631
  • 4
  • 27
  • 49
0
votes
0 answers

code coverage is unknown in type:module in typescript

I am using typescript with node js in my project and wants to know the code coverage. for code coverage i am using nyc. When I write type:module in the project's package.json file. and try to run mocha --require ts-node/register…
0
votes
0 answers

nyc mocha is showing unknown(0%) code coverage with type:module in package.json for typescript

I have used type module for my project in package.json file.now when i added the test with mocha and try to find the code coverage by nyc then it is showing the Unknown 0% coverage for my typescipt file I have all the files are with .ts extension.…
Raj
  • 1
  • 1
0
votes
1 answer

Istanbul code coverage shows branch not covered in constructor

I'm testing my nodejs written typescript with mocha and chai, for code coverage i'm using nyc. as part of my project i'm also using Typeorm as ORM tool and using inversify as IoC container. When writing unit test cases, code coverage says branch not…
Kiran
  • 23
  • 4
0
votes
0 answers

How can I use __coverage__ global object generated by istanbul to get code coverage report?

I'm using istanbul to know what lines of code were executed when I perform an operation on my web app. In order to do this I first instrumented the code using: npx nyc instrument Then I deployed this code and did my testing. This generated a…
Evil_Transistor
  • 188
  • 1
  • 1
  • 10
0
votes
0 answers

How to configure code-coverage in cypress when application is running in a docker container?

My setup: I have an application's source under /client which runs in a docker and mounts on /app/client inside the container and instrumenting it with babel-plugin-istanbul which seems to work fine: However, when cypress with code-coverage plugin…
Stratos Ion
  • 504
  • 3
  • 18
0
votes
0 answers

Why is nyc coverage with typescript (using mocha) returning zero coverage

I was going through some similar questions, tried various .nycrc config options, none of them worked. Here's a repro: https://codesandbox.io/p/sandbox/xenodochial-babbage-jrwj0b If you run npm run coverage, you will…
yinonby
  • 83
  • 1
  • 9
0
votes
1 answer

Why is Istanbul with Qunit able to see my source files, but does not measure their coverage?

I’m creating some modules to work with three-js and since that project uses Qunit, I’m sticking with that. Qunit is running my test scripts correctly. I read a couple quick tutorials on coverage testing with qunit, and Istanbul (nyc) seems to be…
Kevin Nowaczyk
  • 227
  • 1
  • 15
0
votes
0 answers

How to configure Istanbul to ignore methods in Node.js classes

I'm running nyc 15.1.0 with jasmine 4.6.0 to generate code coverage reports for specs for Node.js classes. How do I configure nyc to ignore all methods named "toString" in all classes? I tried adding "ignore-instance-method" and…
Mike Woinoski
  • 3,123
  • 1
  • 16
  • 15
0
votes
0 answers

How to plot on the New York map for big taxi trip data set with having latitude and longitude

I am using the yellow taxi trip data set 2016 for the first six months and with size 10gb. This is my question with having latitude and longitude, How can i plot on the New York map in Jupyter notebook for the pickup and dropoff locations? Thanks in…
0
votes
0 answers

Why does istanbul(nyc) not include judgement in loop, such as while and for in branch coverage?

Why does istanbul(nyc) not include judgement in loop, such as while and for in branch coverage? When I read the global.coverage object, I found that the judgement in while and for was not included in that branch info. For example, it will not…
SNORLAX
  • 135
  • 8
0
votes
0 answers

NYC mocha resulting in 0 coverage

`your "test": "nyc --all --reporter=text-summary mocha --recursive './test/**/*.test.js' --exit", `this results in no coverage any ideas enter image description here I am expecting to show some code coverage points
0
votes
1 answer

nyc mocha is generating nothing despite providing nyc config to package.json

I'm having a bit of trouble using nyc + mocha. My tests are passing but I get no reports, despite adding a nyc configuration object to my package json: //package.json { "name": "open-concepts", "version": "1.0.0", "description": "Simply…
Fares
  • 893
  • 1
  • 11
  • 24
0
votes
0 answers

Code Coverage for Angular 12 application with Selenium

I want to measure code coverage of Angular 12 application. I have Automation test written in Selenium which runs the application deployed on another machine. I have tried the following steps using istanbul: set source maps to true in…
skeptismo
  • 9
  • 2
0
votes
0 answers

istanbuljs / nyc test coverage report validation along with individual files with different configuration

I am writing unit-test cases using mocha, istanbul & nyc. I am trying to check the coverage report should be 80% overall in .nycrc.json. { "statements": 80, "branches": 80, "functions": 80, "lines": 80 } If the consolated report is not…
Art Bindu
  • 769
  • 4
  • 14