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

Adding any tests to app.component.spec.ts (even empty ones) causes other tests to fail

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
angular, typescript
領域
testing-qa

調査の方向性

app.component.spec.ts と、src/components/clickerForm/clickerForm.spec.ts および src/components/clickerButton/clickerButton.spec.ts にあるリンクされた 2 つの spec から始めます。リポジトリをクローンし、npm install を実行し、app.component.spec.ts のテストのコメントを外して、npm test を実行し、相互作用を再現します。完了条件は、テストが互いに影響を与える理由を説明し、テストを独立して実行できる状態に戻すことです。

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

説明

After migrating from @angular/cli to this testing setup, two of my tests started failing. Both of these tests are long standing and have not been modified in ages.

I tried re-writing one of the tests using the latest recommendations on Stack Overflow, to no avail.

To cut a very long story short, I figured out that commenting out the tests in app.component.spec.ts let the tests run fine.

I also tried empty tests (nothing in the test block at all), as well as adding an afterEach() => destroy, which didn't help.

To Replicate:

  • git clone git@github.com:lathonez/clicker.git
  • cd clicker
  • npm install
  • uncomment the tests in app.component.spec.ts
  • npm test

Note

I do not expect a solution to this problem, but I consider leaving the repo in it's current state (as long as we are unable to explain the behaviour) pretty dangerous in terms of other user's time. There is nothing at all to make you think that these tests would be affected by app.component.spec.ts, indeed everything we know about the unit testing setup tells us otherwise. You can easily sink several hours into this problem before coming to this point, or just getting frustrated and binning your perfectly valid tests.

主要言語
TypeScript
スター
370
フォーク
144
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

ionic-team/ionic-unit-testing-example のほかの issue

ionic-team/ionic-unit-testing-example の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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