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

Aberta
#26,470 1 comentário 2 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
35/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
angular, typescript
Domínio
cli, testing

Direção de pesquisa

Reproduza o comportamento com os comandos listados ng new, ng test e ng g component widget e, em seguida, rastreie o fluxo de watch do ng test que detecta e recompila o novo arquivo de teste. Compare as execuções de teste inicial e reiniciada; considera-se concluído quando os testes em arquivos recém-adicionados são executados durante o watch sem reiniciar o processo.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
TypeScript
Estrelas
27k
Forks
11.8k
Merge médio
16h 35min
PRs com merge (30d)
176

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de angular/angular-cli

Todas as issues de angular/angular-cli

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.