developit / developit/jsdom-worker

Issues when running jest with coverage for all packages within a lerna monorepo

Abierto
#10 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
291
Forks
20
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I am not 100% sure if my problem really is jsdom-worker related but I guess here is my best starting point:

I am currently working on a lerna monorepo where one of the packages executes a function in a worker. I therefore included jsdom-worker in the corresponding test for this package. The function is an export from a different file of this package. I had to add `/* istanbul ignore file */` to it because otherwise the coverage would fail due to `cov_*` variables added during testing not being reachable for the worker. Jest is used for testing and coverage.

So far this would be OK - and tests as well as coverage run just fine when run localy from within the package.

But if I do run the coverage from the root directory it always fails with `ReferenceError: cov_2j8vgqrgle is not defined` in `node_modules/jsdom-worker/src/index.js:89:18`.

The function that is run in the worker has a function imported from another package of the monorepo and if I do run global coverage (remember: running coverage from within the package is 100% fine) this one seems to be interpreted and `cov_*` gets added to it which is guaranteed to fail.

Any idea what goes wrong and if there is anything I can do about it?

Guía de contribución

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

Línea de trabajo

Comienza comparando la cobertura de Jest del directorio del paquete con la cobertura de la raíz del repositorio de Lerna, centrándote en node_modules/jsdom-worker/src/index.js:89 y en la función importada del otro paquete del monorepo. Reproduce el ReferenceError y determina por qué la instrumentación cov_* llega al worker; se considera terminado cuando la ejecución de la cobertura en la raíz se realiza sin este fallo.

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

Evaluación

Stack tecnológico
javascript
Área
testing
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.