nyc_output folder not generated during automated build

Aperta
#522 2 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
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
cypress, nodejs, react

Direzione di ricerca

Inizia dalla sezione Debugging del README e riproduci il comando DEBUG=code-coverage npx cypress run localmente e nell’ambiente di build automatizzato. Confronta .nyc_output/out.json e window.__coverage__, quindi esamina la configurazione di @cypress/instrument-cra e il percorso di npm run build. Il lavoro è completato quando è stata identificata la causa dell’output di coverage o dell’instrumentation mancante e sono stati verificati i comportamenti attesi del build automatizzato.

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.

Versions

  • What is this plugin's version? If this is NOT the latest released version can you try the latest version, please? "^3.9.11
  • 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 Cypress version? ^6.0.0
  • What is your operating system? Microsoft OS
  • What is the shell? CMD
  • What is the Node version? 16.3.0
  • What is the NPM version? 7.15.1
  • How do you instrument your application? Cypress does not instrument web application code, so you need to do it yourself.
  • When running tests, if you open the web application in regular browser, and open DevTools, do you see window.__coverage__ object? Can you paste a screenshot? Yes
  • Is there .nyc_output folder? Is there .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? Yes
  • 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
I'm running Cypress with the command
DEBUG=code-coverage npx cypress run
Cypress is able to generate .nyc_output locally, but not in automated build (Codebuild). Should the .nyc_output always be generated by Cypress on every cypress run?

image

I've recently discovered that my app built out to a server is NOT showing code coverage instrumentation in window.__coverage. Does this CRA instrumentation package work only for local environments? How do I instrument the app with npm run build?

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.