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
3
votes
0 answers

Missing .vue file in coverage report

I use vue-cli 3.0 to create my project, and I use istanbul-instrumenter-loader to create my coverage, but I can't find vue file this is my vue.config.js chainWebpack: (config)=>{ config.resolve.alias .set('@', resolve('src')) …
Ling
  • 31
  • 2
3
votes
2 answers

nyc (istanbul) doesn't work when NODE_ENV is set to test

I'm performing mocha tests on my React components that I wrote using ES6 syntax. I'm using Istanbul to do code coverage tests. When i set my NODE_ENV to 'test`, I get the following…
morghulis
  • 145
  • 11
2
votes
0 answers

Get a HTML report from coverage JSON generated from storybook coverage add on

I am trying to get a HTML coverage report produced with the JSON output from the @storybook/addon-coverage plugin. I am using Angular, and have been following this recipe I have checked as per the guide that I am getting coverage generated as per…
mindparse
  • 6,115
  • 27
  • 90
  • 191
2
votes
0 answers

How can I merge coverage reports from jest and playwright using nyc without getting wrong results for functions?

In the project I use playwright to test most of the code. I added jest to test some specific util stuff directly. Playwright and jest generate a json test coverage report which I want to combine to show the total coverage as a HTML report. I managed…
Basti
  • 449
  • 2
  • 13
2
votes
0 answers

Code coverage when running e2e tests on a project with Angular 14 (TypeScript & ESM) + Playwright + Cucumber + nyc

I cannot generate code coverage when I am running my e2e tests. It seems that there is no instrumentation done in this case. I have created a sample app for which I am running one cucumber+playwright test but afterwards I get no coverage…
DDana
  • 117
  • 8
2
votes
0 answers

Running istanbul for code-coverage in a Next.js app

I've built tests using Cypress to test the FE of a Next.js application. now I want to add code-coverage checks to see where and what I need to add and to keep track of my progress. Looking at the guides published by Cypress it seems that istanbuljs…
alon rubin
  • 31
  • 1
  • 2
2
votes
1 answer

How can I make C8 output total code coverage %?

I am able to generate code coverage reports using c8. But how do I output total coverage % every time? Currently, it outputs total coverage % only if it is less than the threshold like this. But I wanted to see the % every time it runs. Config…
Yatin Gupta
  • 653
  • 5
  • 12
2
votes
0 answers

istambul nyc fails to detect any files when running ava test suite

Started trying to integrate nyc/istambul into my ava test suites: ./node_modules/.bin/nyc --include modules/todo.js --es-modules ./node_modules/.bin/ava 1 tests passed ----------|---------|----------|---------|---------|------------------- …
Mark Tyers
  • 2,961
  • 4
  • 29
  • 52
2
votes
0 answers

My Istanbul tests coverage reports zeroes

Though my tests pass with mocha, my coverage is still all zeroes: 5 passing (12ms) -----------|---------|----------|---------|---------|------------------- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s…
Stéphane de Luca
  • 12,745
  • 9
  • 57
  • 95
2
votes
1 answer

No Code Coverage for Fastify Integration Tests Using NYC/Istanbul written in Typescript

I'm currently trying to get code coverage on my fastify routes using Mocha and NYC. I've tried instrumenting the code beforehand and then running the tests on the instrumented code as well as just trying to setup NYC in various ways to get it to…
Christopher
  • 262
  • 2
  • 9
2
votes
1 answer

How can I exclude private constructors which is written in TypeScript from function coverage using nyc?

I want to exclude private constructor from function coverage. Actually I prefer to use private constructor in Factory Pattern. Sample Code class Instance { } class InstanceA extends Instance { public constructor() { super(); } } class InstanceB…
Chris
  • 392
  • 4
  • 16
2
votes
0 answers

nyc + cypress + angular prefixed with webpack:?

How does one setup istanbuls nyc to run test coverage via cypress tests on angular transpiled code? I transpile the code via ng build, it appears in the build/client/ directory, I also transpile my cypress tests and they appear in the…
basickarl
  • 37,187
  • 64
  • 214
  • 335
2
votes
0 answers

Is it possible to show trends from an lcov report in jenkins?

I have an lcov report which produces a pretty html report and an lcov.info file. I want to see on jenkins whether our code coverage is improving or degrading. Is it possible to do this with an lcov report? I can do it using cobertura, but for…
rozza
  • 927
  • 2
  • 11
  • 24
2
votes
1 answer

Enabling nyc / istanbul code coverage for files outside the package directory

I have a node application with separate sister folders and accompanying package.json files for the application code and tests. Project | |-----Application |-----app.js |-----package.json |-----Tests | …
arinray
  • 178
  • 1
  • 12
2
votes
1 answer

How to get nyc coverage to work with es6 import (.mjs files)

I've typically used nyc to provide coverage for my unit tests. All honkey dorey for pre-ES6 require('myModule') tests. I'm having trouble getting it to work with unit tests that use ES6 import. Tests without coverage work with…
user949300
  • 15,364
  • 7
  • 35
  • 66