test_runner: `node --test` silently drops options or args in certain cases
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- javascript, node.js
- Área
- cli, testing-qa
Línea de trabajo
Empieza reproduciendo ambos casos con los comandos node --test indicados en el issue y siguiendo el manejo de los argumentos de la CLI de test_runner. Se considera terminado cuando las rutas posicionales no se descartan silenciosamente: las rutas que no coincidan producen una advertencia o un error, y la opción reporter se acepta después de los argumentos posicionales o se informa claramente de que no es válida.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
v26.3.0
Subsystem
test_runner
What steps will reproduce the bug?
Either of the following:
node --test no-tests-here "spec/*.test.js"
node --test "spec/*.test.js" --test-reporter tap
What is the expected behavior? Why is that the expected behavior?
In the first case, since positional args are taken as a path or glob for tests to be run, each arg should result in at least one test found and successfully run, else a warning or error should be printed, e.g.:
No tests were found at "no-tests-here".
In the second case, ideally the CLI parsing is changed to allow options to come after positional args (see also #51384 and nodejs/test-runner#13), and --test-reporter tap results in the TAP test reporter being used. If that is not possible, then warnings or errors like the first case:
No tests were found at "--test-reporter".
No tests were found at "tap".
The reason for the warnings or errors is that when a positional arg does not resolve to a single test file, it is most likely a user mistake/typo, or as in the second case, the natural but incorrect assumption that options can be specified at the end.
What do you see instead?
"no-tests-here" in the first case and "--test-reporter tap" in the second are dropped without warning or error.
- Lenguaje dominante
- JavaScript
- Estrellas
- 122k
- Forks
- 37.4k
- Merge medio
- 4 d 4 h
- PR fusionados (30 d)
- 276
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de nodejs/node
-
doc
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
build
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
feature request
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Todos los issues de nodejs/node
Issues similares
-
bot:ai-assisted component:compact-js status:untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
midnightntwrk/midnight-sdk#403 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
DavidAnson/markdownlint-cli2#940 ·
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100