Error: zone-testing.js is needed for the fakeAsync() test helper but could not be found. When...

Discussão em 'Angular' iniciado por Zhen Wei, Novembro 2, 2024.

  1. Zhen Wei

    Zhen Wei Guest

    I am trying to run component testing on Angular web app using serenityJS + Jasmine but encountered the error below. Any idea how I can resolve this issue?

    Message:


    Error: zone-testing.js is needed for the fakeAsync() test helper but could not be found. Please make sure that your environment includes zone.js/dist/zone-testing.js Stack:

    Error: zone-testing.js is needed for the fakeAsync() test helper but could not be found.
    Please make sure that your environment includes zone.js/dist/zone-testing.js
    at resetFakeAsyncZone (C:\Users\zhenweiwong\Desktop\serenityjsframework\packages\core\testing\src\fake_async.ts:25:9)
    at UserContext.<anonymous> (C:\Users\zhenweiwong\Desktop\serenityjsframework\packages\core\testing\src\before_each.ts:26:5)
    at <Jasmine>
    at processImmediate (internal/timers.js:439:21)
    at process.topLevelDomainCallback (domain.js:131:23)
    Message:
    Error: In this configuration Angular requires Zone.js
    Stack:
    Error: In this configuration Angular requires Zone.js
    at new NgZone (C:\Users\zhenweiwong\Desktop\serenityjsframework\packages\core\src\zone\ng_zone.ts:129:13)
    at TestBedViewEngine._initIfNeeded (C:\Users\zhenweiwong\Desktop\serenityjsframework\packages\core\testing\src\test_bed.ts:409:9)
    at TestBedViewEngine.createComponent (C:\Users\zhenweiwong\Desktop\serenityjsframework\packages\core\testing\src\test_bed.ts:599:10)
    at Function.TestBedViewEngine.createComponent (C:\Users\zhenweiwong\Desktop\serenityjsframework\packages\core\testing\src\test_bed.ts:245:36)
    at UserContext.<anonymous> (C:\Users\zhenweiwong\Desktop\serenityjsframework\jasmine-test\spec\app1.component.spec.ts:32:29)
    at <Jasmine>​

    Continue reading...

Compartilhe esta Página