Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Test runner: --test-reporter-destination should create the folder if not found

Aperta
#64,994 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
javascript, node.js
Ambito
cli, testing-qa

Direzione di ricerca

Inizia riproducendo il problema con il comando fornito node --test --experimental-code-coverage --test-reporter-destination="coverage/lcov.info" quando coverage non esiste. Traccia la gestione della destinazione del reporter da parte del test runner e verifica che la cartella di destinazione venga creata prima della scrittura del report di coverage, anche quando sono necessarie cartelle annidate.

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

Descrizione

feature request test_runner
What is the problem this feature will solve?

Hi 👋

Fairly easy one:
I have node --test --experimental-code-coverage --test-reporter-destination="coverage/lcov.info" outputting the coverage file to the coverage folder.

However, if the coverage folder does not exist beforehand, an ENOENT is thrown.

Since storing the behavior of storing coverage in coverage/lcov.info, and having that folder in .gitignore is rather standard, it'd be nice to have Node creating the folder in which it will place the coverage report in case it doesn't exist.

Thanks :)

What is the feature you are proposing to solve the problem?

When writing coverage report, check if the destination folder exists, and if not, create it beforehand

What alternatives have you considered?
  • version controlling the coverage folder with a .gitkeep file, but it's cumbersome
  • Having the CLI test script in my package json create the folder itself, but that's quite inelegant to maintain for both Windows and Unix users
  • Switching to another test runner and losing all the charisma points that come with using the native one
Lingua principale
JavaScript
Stelle
122k
Fork
37.4k
Merge medio
4g 3h
PR unite (30g)
279

Guida per i contributori

Apri la 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 nodejs/node

Tutte le issue di nodejs/node

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.