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
2
votes
1 answer

nyc with webpack 4 using .tmp folder

I am currently using: "mocha": "^5.2.0" "mocha-webpack": "^2.0.0-beta.0" "webpack": "^4.19.1" "nyc": "^13.0.1" and for some reason, I'm getting weird source files. .tmp/mocha-webpack/1537879911832/webpack:/src | 61.18…
A. L
  • 11,695
  • 23
  • 85
  • 163
2
votes
0 answers

Code coverage of Meteor application after deployment

Meteor application has built with 'meteor build' command and then deployed. After deployment application runs using plain node command 'node bundle/main.js'. Running nyc using command 'nyc node main.js' only give the partial results from the meteor…
2
votes
1 answer

Include file from node_modules to nyc

I want to use nyc to generate code-coverage. I am building some of my projects into node_modules to use them in other projects. When writing tests I want to test the files inside node_modules and therefore I want to include files from…
Robert K
  • 21
  • 4
2
votes
1 answer

Istanbul coverage issue "else path not taken" but clearly is

I have this piece of code below, and I am using nyc and babel to create a coverage report. For some reason the report is giving me an issue "else path not taken" but there's nothing I can do to stop this. Why is this here? How can I make it go…
ThomasReggi
  • 55,053
  • 85
  • 237
  • 424
2
votes
1 answer

Unable to use nyc/istanbul for code coverage

I am using nightwatch for selenium based tests, but when I use nyc nightwatch, it only reports the test code and their 100% coverage. This is my primary blocker right now. How do I get the coverage? Basically, I want to get this as a report in…
xploreraj
  • 3,792
  • 12
  • 33
  • 51
2
votes
1 answer

Instrumenting files on the fly with Istanbul

I can instrument a file/folder and write it to disk like so: $ istanbul instrument public --output public-coverage --embed-source true however I am wondering if there is a way to instrument files on the fly and serve them to the browser without…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
1
vote
1 answer

nyc code coverage not working for NodeJs express server

I have a NodeJs express server named app.js, I want to do a code coverage using nyc. // app.js const express = require('express') const app = express() const port = 3000 app.get('/', (req, res) => { res.send({ message: 'Hello World!' …
Peter Huang
  • 972
  • 4
  • 12
  • 34
1
vote
0 answers

Code coverage for integration test by jest and nyc always return 0% for statements and lines

I'm trying to do code coverage for our Jest integration tests. The tests directory is inside some sub-directory inside the server project with standalone package.json and configurations. The services and libs that need to cover are located in the…
Idan QA
  • 53
  • 3
  • 8
1
vote
0 answers

Get combined code coverage for cucumber-js and mochaJS test cases using NYC

In our codebase, we have written acceptance test cases in cucumber-js and unit tests in mocha js. The individual way to run these is by: Mocha - "test:mocha-coverage": "nyc npm run test" Cucumber - "test:cucumber-coverage": "nyc npm run…
raman077
  • 117
  • 1
  • 7
1
vote
1 answer

Certain files not being instrumented for code coverage using nyc (istanbul)

I'm experiencing an issue where some of my files are not being included in my nyc test coverage report. I want all my files to be included in my test coverage report even if they have 0% of their lines run by tests. So I included the flag…
1
vote
0 answers

Can nyc generate a combined coverage report, that shows which individual reports cover which part of the file?

I'm converting Mocha tests to Jest, and want to maintain coverage I have figured out how to combine coverage, based on Merging coverage reports from nyc and some other similar questions. However, when combining the two .json files, the numbers are…
AncientSwordRage
  • 7,086
  • 19
  • 90
  • 173
1
vote
1 answer

Permission denied when running npm test via mocha and nyc on Travis-CI

I'm setting up my server side for NodeJS application which I'm integrating with Travis-CI. I'm using Mocha and NYC to help with my tests. However, while these tests run fine locally, I'm failing the tests when on Travis-CI. Locally everything works…
maximus383
  • 584
  • 8
  • 25
1
vote
0 answers

How do I instrument `.vue` files using the istanbul/nyc command line

Ultimately, I am trying to instrument my Vue 3 app so that I can get code coverage that includes my .js and .vue files using the below command: nyc instrument --compact=false src instrumented I see that my .vue files are getting duplicated and…
1
vote
1 answer

Get code coverage only for a folder in Cypress

I am using Cypress and Nyc configurations. My folder structure looks like this: |/project | /coverage/ /lcov-report /index.html |/cypress | /main /car /car.spec.tsx /color.spec.tsx ... | /integration I need a solution to…
Asking
  • 3,487
  • 11
  • 51
  • 106
1
vote
1 answer

How does nyc istanbul pass instrumented code to test runners?

I've been trying to generate code coverage for a vanilla Typescript (no react or any web frameworks) project on Webpack 5 using Cypress for unit testing. I'm not able to generate code coverage for it as if I'm failing to tell Cypress that it needs…
supertonsky
  • 2,563
  • 6
  • 38
  • 68