caolan / caolan/nodeunit

Undone tests fail silently when using the JUnit reporter

Abierto
#157 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
1.9k
Forks
359
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

When running unit tests at the command line, using the default reporter, I get the following error in the console if there are undone tests:

_FAILURES: Undone tests (or their setups/teardowns):
details of my test here
To fix this, make sure all tests call test.done()_

However, when using the JUnit reporter, the failure is completely silent - no XML files are written. In our case, this means that our CI system (Jenkins) doesn't see the failures (or indeed any results) and hence marks the build as a success.

I would expect the results to still be written in this case, so that we can see which tests have passed and which have failed.

Note that the cause of undone tests isn't always due to the developer failing to call test.done() - in this specific case, the test.done() was in a callback within the unit test that ended up not getting called due to regression introduced in the production code being tested.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Empieza rastreando cómo el reporter de JUnit gestiona las pruebas no terminadas y compáralo con la ruta de error del reporter predeterminado. Reproduce el problema con una prueba no terminada y, a continuación, verifica que el reporter escriba XML que contenga los resultados relevantes, tanto aprobados como fallidos, en lugar de permanecer en silencio.

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

Evaluación

Stack tecnológico
javascript
Área
testing-qa
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.