nodejs / nodejs/node

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

Abierto
#64,994 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

feature request test_runner
Lenguaje dominante
JavaScript
Estrellas
122k
Forks
37.3k
Merge medio
4 d 2 h
PR fusionados (30 d)
283

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza reproduciendo el problema con el comando proporcionado node --test --experimental-code-coverage --test-reporter-destination="coverage/lcov.info" cuando coverage no existe. Rastrea el manejo del destino del reporter por parte del ejecutor de pruebas y verifica que la carpeta de destino se cree antes de escribir el informe de coverage, incluso cuando se necesitan carpetas anidadas.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, node.js
Área
cli, testing-qa
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
68/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.