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

Feature request: `td.func().reset()` (reset spy/stub state)

Aperta
#529 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@MatrixNeoKozak ci sta già lavorando.

Dal 13/10/2026.

  • #551 di @MatrixNeoKozak — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
testing

Direzione di ricerca

Start by locating the spy and stub state-management code and the existing tests for reusable doubles. Confirm how state is currently replaced, then add coverage for resetting a double in place so its call history and stub state are cleared without replacing the dependent module.

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

Descrizione

In many cases, spies are re-useable, so they can be set up at the root of the test.

When asserting cases where a spy may or may not have been called, the spy's state needs to be re-set between cases (via afterEach).

At current, it seems the only way to effectively re-set a testdouble spy/stub's state is to overwrite the whole thing with a fresh spy, which creates a daisy-chain of make-work: that spy is likely being fed into a module replacement, so now the module has to be needlessly replaced every time the spy/stub is re-set.

Lingua principale
JavaScript
Stelle
1.4k
Fork
141
Merge medio
2h 30m
PR unite (30g)
10

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.