Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add a warning when trying to replace and already replaced function

Aperta
#281 5 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
testing

Direzione di ricerca

The issue names no files, tests, or specific entry points. Start by locating the function-replacement API and the td.reset() cleanup path, then clarify whether repeated replacement should warn, prevent the operation, or restore the original double. Done criteria should cover the second replacement and cleanup between tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

We just ran into a strange issue where our tests accidentally replaced the same function twice where the second replace then replaced the testdouble function with yet another one. The td.reset() that is then run after each test only undid the second replace which left us still with with a replaced testdouble function for the next test.

I think it would be great if testdouble could help prevent/fix this situation somehow as - to us - it was very non-obvious what was going on and took some time to debug.

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di testdouble/testdouble.js

Tutte le issue di testdouble/testdouble.js

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.