Code Coverage html report is empty

Aperta
#848 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cypress, react, typescript
Ambito
testing

Direzione di ricerca

Riproduci il problema usando il repository collegato Cypress_CodeCoverage_ReactApp ed esegui npm run coverage:report dopo aver confermato che window.__coverage__ e .nyc_output/out.json siano popolati. Confronta il report HTML generato con il comportamento descritto nell’issue #227; il lavoro è completato quando il report contiene la coverage raccolta invece di essere vuoto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Logs and screenshots
Please provide debug logs by running Cypress from the terminal with DEBUG=code-coverage environment variable set. See the Debugging section of the README file.

Screenshot 2024-07-09 at 12 14 18

Versions

  • What is this plugin's version? If this is NOT the latest released version, can you try the latest version, please? Latest
 "cypress/code-coverage": "3.12.39",
 "istanbul-lib-coverage": "3.2.2",
 "nyc": "17.0.0",

"dependencies": 
    "cypress/instrument-cra": "1.4.0",
    "babel-plugin-istanbul": "6.1.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",

"scripts": 
    "start": "react-scripts -r @cypress/instrument-cra start",
    "build": "react-scripts build",
    "test": "react-scripts test cypress run",
    "eject": "react-scripts eject",
    "coverage:report": "nyc report --reporter=html --reporter=text-summary",
  • If the plugin worked before in version X but stopped after upgrading to version Y, please try the released versions between X and Y to see where the breaking change was.

  • What is the Cypress version?
    Cypress package version: 13.6.6
    Cypress binary version: 13.6.6
    Electron version: 27.1.3

  • What is your operating system? mac os

  • What is the shell? Zsh

  • What is the Node version?
    Bundled Node version: 18.17.1

  • What is the NPM version?
    10.5.0

  • How do you instrument your application? Cypress does not instrument web application code, so you must do it yourself. https://istanbul.js.org/ instanbul tool latest

  • When running tests, if you open the web application in a regular browser and open DevTools, do you see window.__coverage__ object? Can you paste a screenshot? Yes I can see it.

  • Is there a .nyc_output folder? Is there a .nyc_output/out.json file? Is it empty? Can you paste at least part of it so we can see the keys and file paths? It's not empty

  • Do you have any custom NYC settings in package.json (nyc object) or in other NYC config files? No

  • Do you run Cypress tests in a Docker container? No

Describe the bug
NYC reports and counters are generated but the code coverage HTML file is empty. The window.coverage object is present.

Screenshot 2024-07-09 at 11 14 00

Link to the repo
(https://github.com/Isurunc/Cypress_CodeCoverage_ReactApp/tree/master)

my issue is similar to https://github.com/cypress-io/code-coverage/issues/227

Lingua principale
TypeScript
Stelle
440
Fork
114
Merge medio
42m
PR unite (30g)
19

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cypress-io/code-coverage

Tutte le issue di cypress-io/code-coverage

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.