ng test does not run tests from new test files when watching

オープン
#26,470 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る

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

評価

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

調査の方向性

列挙された ng newng testng g component widget コマンドで動作を再現し、その後、新しいテストファイルを検出して再コンパイルする ng test の watch フローを追跡します。初回のテスト実行と再起動後のテスト実行を比較します。watch 中に新しく追加されたファイルのテストがプロセスを再起動せずに実行されれば完了です。

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

説明

area: @angular-devkit/build-angular devkit/build-angular:karma freq1: low severity3: broken type: bug/fix
Command

test

Is this a regression?
  • Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was

No response

Description

While ng test is running and watching for changes, if you add a new test file, that file is detected and causes the tests to run again, but the tests in that new file are not included in the test run. To include the tests from the new file, you need to restart the ng test process.

Minimal Reproduction
  1. In a terminal, run:
ng new watch --skip-git --style css --ssr=false 
ng test
  1. Three tests are run.
  2. In a second terminal, run:
ng g component widget
  1. A new component is created with a test file that contains one test.
  2. The new test file is detected and the tests recompile.
  3. Only three tests are run.
  4. Add another test to the new component's test file.
  5. The change is detected and the tests recompile.
  6. Only three tests are run.
  7. Kill the ng test process.
  8. Run ng test again.
  9. Five tests are run.
Exception or Error

No response

Your Environment
_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 17.0.3
Node: 20.9.0
Package Manager: npm 10.1.0
OS: win32 x64

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1700.3 (cli-only)
@angular-devkit/core         17.0.3 (cli-only)
@angular-devkit/schematics   17.0.3 (cli-only)
@schematics/angular          17.0.3 (cli-only)
Anything else relevant?

Here's a screen recording to help explain what I'm seeing.
ng-test-watch

主要言語
TypeScript
スター
27k
フォーク
11.8k
平均マージ
16時間 35分
マージ済み PR(30日)
176

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

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

はじめの一歩

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

angular/angular-cli のほかの issue

angular/angular-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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