Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

460
Visualizações
zone-testing.js es necesario para fakeAsync()

Soy nuevo con la prueba unitaria de angular y estoy usando jest, lo instalo con ng add @briebug/jest-schematic. Cuando ejecuta la prueba npm (broma) en un proyecto base, arroja el siguiente error

 FAIL src/app/app.component.spec.ts (7.418 s) AppComponent ✕ should create the app (6 ms) ● AppComponent › should create the app 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 (../packages/core/testing/src/fake_async.ts:25:9) at Object.<anonymous> (../packages/core/testing/src/test_hooks.ts:39:7) at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13) at runJest (node_modules/@jest/core/build/runJest.js:387:19) at _run10000 (node_modules/@jest/core/build/cli/index.js:408:7) at runCLI (node_modules/@jest/core/build/cli/index.js:261:3) Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 0 total Time: 9.579 s

Cómo resolver este problema, gracias y aquí está el componente de la aplicación.

 import { TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ RouterTestingModule ], declarations: [ AppComponent ], }).compileComponents(); }); it('should create the app', () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app).toBeTruthy(); }); });
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda