caolan / caolan/nodeunit

How to export function from module without nodeunit testing it?

Abierto
#353 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

I've got a few tests scattered throughout multiple files.

Currently I just run `nodeunit .`, nodeunit then tests them all successfully. Great!

But I want to export a function from one of my files so that another can call it. The problem is that when I run `nodeunit .` that function now gets called.

How can I run tests on all files? I'm used to python's `nose` library, which only tests functions that have `test` in the function name.

Do I need to move all tests into a seperate file to the functionality? I don't want to do that. I like putting tests adjacent to the code they're testing.

Guía de contribución

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

Línea de trabajo

Empieza leyendo el comportamiento de nodeunit al descubrir pruebas y cargar módulos en torno al comando `nodeunit .`; el issue no especifica archivos fuente ni pruebas. Compara cómo se tratan las funciones exportadas con la disposición deseada de pruebas adyacentes. Se considera terminado cuando todas las pruebas previstas siguen ejecutándose sin invocar funciones auxiliares exportadas para su reutilización.

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
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.