Rename and/or replace `coverage:report` script

Aperta
#545 0 commenti 2 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
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cypress, typescript
Ambito
testing

Direzione di ricerca

Inizia esaminando la voce coverage:report in package.json e la configurazione della coverage di Cypress descritta in cypress.json e .nycrc. Determina se l’ambito richiesto consiste in una ridenominazione specifica per Cypress oppure in opzioni nyc configurabili in cypress.json; il lavoro è completato quando la coverage di Cypress rimane configurabile senza un nome generico e fuorviante per lo script.

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

Descrizione

Is your feature request related to a problem? Please describe.
Currently, if you want to have different nyc options for your Cypress tests (for example if you're using a different test runner for unit tests), the only way to pass custom options is to use the coverage:report script in package.json. This approach is problematic because it's essentially a magic script name—new developers coming on to a project would have no indication what this script is for. What's worse, because it's in package.json, you can't even add a code comment to explain it. Your only option is to add something to a README or other documentation and hope that people actually read it.

Describe the solution you'd like
The ideal solution would be to make this command (as well as nyc options in general) configurable in cypress.json instead of relying on a magic script.

But at the very least, I feel the script should be renamed to something that makes it clear that this is related to Cypress, such as cypress:coverage:report. The current name is completely generic, and sounds like it should be used by the developer for generating generalized coverage reports.

Describe alternatives you've considered
In theory one workaround for this situation is to simply set the desired nyc config in the project's global .nycrc and instead pass a custom config for the other (i.e., unit) test runner. But this is still problematic because it would still not be immediately obvious that the global .nycrc config is actually specific to Cypress (again, one cannot add comments to it because of the JSON format).

Additional context
Just to reiterate, this is chiefly for a scenario where a different nyc config is desired for different test runners.

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.