Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Weird bug with Angular unit tests

オープン
#10,046 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
angular, typescript

調査の方向性

リンク先の最小限の例で、ng test を使って動作を再現し、クラスフィールドの行をコメントアウトした場合とコメントアウトしていない場合の app.ts を比較します。まず Angular アダプター内の fixture.whenStable() と query.data を追跡します。動作を理解し、期待される結果を焦点を絞ったテストでカバーできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
50.4k
フォーク
4.2k
平均マージ
21時間 23分
マージ済み PR(30日)
274

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/query のほかの issue

TanStack/query の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。