Test runner: --test-reporter-destination should create the folder if not found
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 122k
- Forks
- 37.3k
- Ø Merge
- 4 T. 2 Std.
- Gemergte PRs (30 T.)
- 283
Beschreibung
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
.gitkeepfile, but it's cumbersome - Having the CLI
testscript 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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Problem mit dem bereitgestellten Befehl node --test --experimental-code-coverage --test-reporter-destination="coverage/lcov.info" zu reproduzieren, wenn coverage nicht existiert. Verfolge die Verarbeitung des Reporter-Ziels durch den Test-Runner und überprüfe, dass der Zielordner erstellt wird, bevor der Coverage-Bericht geschrieben wird, auch wenn verschachtelte Ordner erforderlich sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, node.js
- Bereich
- cli, testing-qa
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 68/100