after reset, don't bust cache for modules that weren't busted/replaced previously
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, nodejs
- Ambito
- testing-qa
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- JavaScript
- Stelle
- 1.4k
- Fork
- 140
- Merge medio
- 5h 55m
- PR unite (30g)
- 4
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di testdouble/testdouble.js
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
testdouble/testdouble.js#537 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
testdouble/testdouble.js#536 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
testdouble/testdouble.js#534 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 45/100
testdouble/testdouble.js#533 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
testdouble/testdouble.js#532 · 1 commento ·
Tutte le issue di testdouble/testdouble.js
Issue simili
-
feature task
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RealDevSquad/website-www#1178 ·
-
add latest sol modelAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
netlify-labs/nax#56 · 2 commenti · 1 reazione ·
-
accessibility bug revealjs
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
quarto-dev/quarto-cli#14961 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
PnX-SI/GeoNature#4435 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
openlayers/openlayers#17648 ·
I maintainer di solito rispondono entro 1 giorno