after reset, don't bust cache for modules that weren't busted/replaced previously
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, nodejs
- Área
- testing-qa
Línea de trabajo
Start by running npm run test in the attached jasmin-testdoubleBugExample.zip with Node 24.13.0 on Windows 11, then trace testdouble's ESM replacement and reset handling around the module cache. Done means a second jasmine.execute() does not reload untouched spec files after reset, while modules previously replaced through replaceEsm() still receive the intended cache treatment.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Here is a zip file with a working demonstration of the problem (npm run test from inside the folder; node version 24.13.0; Windows 11)
jasmin-testdoubleBugExample.zip
My team uses infrastructure to connect loaded code to the chrome nodejs devtools, in order to enable us to debug our code more easily. It is very common for us to run our jasmine tests more than once in a session. That is what the sequential calls to running the tests are meant to simulate.
Sometimes our jasmine tests use testdouble to replace esm dependencies. Every time jasmine.execute() is called, it will use dynamic import to load all spec files, regardless of whether it has loaded it before, relying on the module cache to prevent re-running specs.
So, the first time, jasmine loads the tests and runs them just fine. During the tests, a module is mocked using td.replaceEsm(). At the end of the tests, td.reset() is called.
The second time, jasmine loads the files again using dynamic import, and testdouble causes the cache to be busted for the test files, despite the fact that, up until this point, testdouble has not been asked about loading the test files at all. This causes the spec file to be run again, and jasmine complains about duplicate specs (even if it didn't error, getting duplicate tests added would be aggravating).
While jasmine could help itself by not trying to reload files that it has already loaded (and I have put in an issue about that), there is also no reason for testdouble to be busting cache on those files, seeing as they are not part of the tree of anything imported while replaceEsm was active, and reset was called before further attempts to import these files occurred.
- Lenguaje dominante
- JavaScript
- Estrellas
- 1.4k
- Forks
- 140
- Merge medio
- 5 h 55 min
- PR fusionados (30 d)
- 4
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 testdouble/testdouble.js
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
testdouble/testdouble.js#537 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
testdouble/testdouble.js#536 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
testdouble/testdouble.js#534 ·
-
`npm-run-all` to `npm-run-all2`Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 45/100
testdouble/testdouble.js#533 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 32/100
testdouble/testdouble.js#532 · 1 comentario ·
Todos los issues de testdouble/testdouble.js
Issues similares
-
[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
stac-utils/stac-fields#42 ·
-
[sec-check] SVG remote-reference gate misses src attributes, link hrefs and bare-string @importAbiertoagent/security hive/hosted-available-lke648397-260827-5n31 security
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Fix #3381 does not fix #3343: watch() returns the ref, not the value, so setup() never re-runsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Add: Eurosport 1 PolskaAbiertochannels:add check:passed
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días