question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nyc not generating report

See original GitHub issue

Link to bug Demo repo: https://github.com/mega6382/nyc-bug-demo

I am using nyc with mocha to generate reports for my tests in html and lcov, it was working fine until recently but then it suddenly stopped working even though I haven’t changed anything.

Expected Behavior

Tests should run and return a proper test report in html and lcov

Observed Behavior

No report is generated

Environment Information

Node v10.15.1 Npm 6.9.0 run the following script:

  npm install
  npm test

Here is the out put that I get now:

  Test Express Server on 3000 port
    √ Send Request(Server Test)


  1 passing (62ms)

----------|----------|----------|----------|----------|-------------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files |        0 |        0 |        0 |        0 |                   |
----------|----------|----------|----------|----------|-------------------|

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
coreyfarrellcommented, May 28, 2019

@mega6382 yes. I believe you need to configure extension to nyc:

  "nyc": {
    "exclude": [
      "**/sentryHelper.*",
      "**/*.test.*"
    ],
    "extension": [
       ".ts"
    ],
    "reporter": [
      "lcov",
      "text"
    ]
},

nyc@14 requires that extension match the original source filename (.ts in your case). In nyc@15 the extension option will include .ts by default.

0reactions
mega6382commented, May 28, 2019

@coreyfarrell Thanks, just checked and it seems that i updated nyc 11 days ago from 13.3.0 to 14.1.1 and it probably started failing after that.

Thanks for your help, it is working now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to generate nyc report from json results (no .nyc_output)?
One problem here, I think, is that I have no .nyc_output directory with intermediate results, since I'm not using nyc to generate coverage...
Read more >
istanbuljs/nyc - Gitter
In my NYC report it shows files from <project_path>/src/ folder (as expected) as well as the files from home/runner/work/ folder. Is there a...
Read more >
Coverage | Code Cookbook - Michael Currin
{ "scripts": { "cover:unit": "nyc --silent npm run test:unit", "cover:integration": "nyc --silent --no-clean npm run test:integration", "cover:report": "nyc ...
Read more >
nyc/README.md - UNPKG
195, nyc report --reporter=<custom-reporter-name>. 196, ```. 197. 198, ## Producing instrumented source. 199. 200, The `nyc instrument` command can produce ...
Read more >
vue-nyc - npm
nyc may create artifact directories within the project root, with these defaults: the report directory, <project-root>/coverage; the cache ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found