Olá, bom dia! Dúvida, ao executar os teste via terminal, todas as suites e teste de casos passam com sucesso. Atualmente começou a executação dos testes automáticamente, ao salvar o arquivo, e o resultado dele é diferente dos executado manualmente.
// EXECUTADO MANUALMENTE ng test Determining test suites to run...@angular/compiler-cli@17.2.3 detected. Skipping 'ngcc' Tip: To avoid this message you can remove 'jest-preset-angular/global-setup' from your jest config PASS src/app/services/livro.service.spec.ts PASS src/app/componentes/cabecalho/cabecalho.component.spec.ts
Test Suites: 2 passed, 2 total Tests: 6 passed, 6 total Snapshots: 0 total Time: 6.205 s Ran all test suites.
// EXECUTADO AUTOMATICAMENTE TestRun "[3618-organo] watch-tests:0:process-start:0 (38)" started FAIL src/app/componentes/cabecalho/cabecalho.component.spec.ts CabecalhoComponent × Deveria criar o componente (13 ms)
● CabecalhoComponent › Deveria criar o componente
Need to call TestBed.initTestEnvironment() first
6 |
7 | beforeEach(async () => {
> 8 | TestBed.configureTestingModule({
| ^
9 | imports: [CabecalhoComponent],
10 | });
11 | component = new CabecalhoComponent(); // Cria uma nova instância do componente antes de cada test
at _TestBedImpl.get compiler [as compiler] (node_modules/@angular/core/fesm2022/testing.mjs:1970:19)
at _TestBedImpl.configureTestingModule (node_modules/@angular/core/fesm2022/testing.mjs:1873:14)
at Function.configureTestingModule (node_modules/@angular/core/fesm2022/testing.mjs:1700:37)
at Object.<anonymous> (src/app/componentes/cabecalho/cabecalho.component.spec.ts:8:13)
● CabecalhoComponent › Deveria criar o componente
zone-testing.js is needed for the fakeAsync() test helper but could not be found.
Please make sure that your environment includes zone.js/testing
at resetFakeAsyncZone (node_modules/@angular/core/fesm2022/testing.mjs:402:11)
at Object.<anonymous> (node_modules/@angular/core/fesm2022/testing.mjs:2190:13)
Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 0 total Time: 4.56 s Ran all test suites related to changed files.
Por favor, poderiam me auxiliar com esse problema.