Skip to content

The index.html show unknown% and a blank report even after out.json has data. #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
maddy619 opened this issue May 4, 2020 · 6 comments

Comments

@maddy619
Copy link

maddy619 commented May 4, 2020

image

Out.json
image

Versions

 "@cypress/code-coverage": "3.2.2",
    "cypress": "3.6.1",
    "istanbul-instrumenter-loader": "^3.0.1",
    "ngx-build-plus": "^7.8.3",
    "nyc": 15.0.1 

nyc comes with cypress code-coverage plugin

{
  "D:\\Project\\projects\\feature-x\\src\\app\\app.module.ts": {
    "path": "D:\\Project\\projects\\feature-x\\src\\app\\app.module.ts",
    "statementMap": {
      "0": {
        "start": {
          "line": 2,
          "column": 17
        },
        "end": {
          "line": 7,
          "column": 1
        }
      },
      "1": {
        "start": {
          "line": 3,
          "column": 12
        },
        "end": {
          "line": 3,
          "column": 28
        }
      },
      "2": {
        "start": {
          "line": 3,
          "column": 34
        },
        "end": {
          "line": 3,
          "column": 125
        }
      },
      "3": {
        "start": {
          "line": 4,
          "column": 4
        },
        "end": {
          "line": 5,
          "column": 150
        }
      },
  • Do you have any custom NYC settings in package.json -No
  • Do you run Cypress tests in a Docker container? - No on local

I am working on angular app, using typescript and ts-loader. I am able to successfully instrument code. The folder structure is something like this.
Code folder: Project/projects/feature-x/src/app
Cypress folder: Project/projects/feature-cypress/cypress.

Coverage.webpack.js is parallel to cypress folder.

@bahmutov
Copy link
Contributor

bahmutov commented May 5, 2020

Can you include DEBUG logs please https://github.com/cypress-io/code-coverage#debugging or give a link to the repo?

@johanbook
Copy link

johanbook commented Sep 3, 2020

I'm experiencing a similar problem. The file nyc_output/out.json is populated with data and I use @cypress/instrument-cra which neatly makes __coverage__ available. Reports generated by nyc are empty. However, the report generated by Cypress in coverage/lcov-report/index.html renders as it's supposed to.

@ari-luokkala
Copy link

ari-luokkala commented May 18, 2021

What is the situation with this, I get same behaviour as described above, html report is generated, also nyc out.json, but nyc command line tool bundled within generates always 'Unknown' for code coverage?

Versions:
node v12.18.4 +

"@cypress/code-coverage": "3.9.5",
"cypress": "7.3.0",

@Isurunc
Copy link

Isurunc commented Jul 9, 2024

@bahmutov bahmutov what could be the reason for this? Could you provide a solution for this

@bahmutov
Copy link
Contributor

bahmutov commented Jul 9, 2024

@Isurunc I don't maintain this plugin, I have my own fork here https://github.com/bahmutov/cypress-code-coverage

@Isurunc
Copy link

Isurunc commented Jul 10, 2024

@Isurunc I don't maintain this plugin, I have my own fork here https://github.com/bahmutov/cypress-code-coverage

thanks. will check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants