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

Weird bug with Angular unit tests

Aperta
#10,046 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
angular, typescript

Direzione di ricerca

Riproduci il comportamento nell’esempio minimo collegato con ng test, confrontando app.ts con la riga del campo della classe commentata e non commentata. Inizia tracciando fixture.whenStable() e query.data nell’adapter Angular. Il lavoro è concluso quando il comportamento è compreso e il risultato atteso è coperto da un test mirato.

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

Descrizione

package: angular-query
Describe the bug

In the docs it says that in the unit tests we should await fixture.whenStable() so a query completes and we get its resulted data. It is true but if I add a class field that references to query.data the query's data becomes undefined.

Your minimal, reproducible example

https://github.com/ms-dosx86/test-when-stable

Steps to reproduce
  1. Run ng test
  2. See that the test passes
  3. Uncomment the commented line in app.ts
  4. Run the test again
  5. Test fails
Expected behavior

I'm not sure what's going on there but I have a feeling that creating a class field that references to query.data shouldn't cause such behaviour.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform
  • MacOS 26.0.1 (25A362)
  • Chrome 143.0.7499.193
Tanstack Query adapter

angular-query

TanStack Query version

5.90.22

TypeScript version

5.8.2

Additional context

No response

Lingua principale
TypeScript
Stelle
50.4k
Fork
4.2k
Merge medio
21h 23m
PR unite (30g)
274

Preparare l'ambiente

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 TanStack/query

Tutte le issue di TanStack/query

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.