mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
`AsyncTestZoneSpec` triggers jasmine `done()` function multiple times and causes warning ``` An asynchronous function called its 'done' callback more than once. This is a bug in the spec, beforeAll, beforeEach, afterAll, or afterEach function in question. This will be treated as an error in a future version. See<https://jasmine.github.io/tutorials/upgrading_to_Jasmine_4.0#deprecations-due-to-calling-done-multiple-times> for more information ``` The reproduce case will be running some `Zone.run()` inside `waitForAsync()`. ``` it('multiple done', waitForAsync(() => { Zone.current.run(() => {}); Zone.current.run(() => {}); })); ``` The reason the `done()` is called in the `onInvoke()` hook is to handle the case that the testBody is totally sync, but we should only do this check for the entry function not for all `Zone.run()` scenario. Another issue is if we run nested zone inside `waitForAsync()`, the `onHasTask()` hook will be triggered multiple times, and cause `done()` be triggered multiple times, so we need to only trigger the `done()` when the zone is `AsyncTestZone`. PR Close #45025 |
||
|---|---|---|
| .. | ||
| browser | ||
| closure | ||
| common | ||
| extra | ||
| jasmine | ||
| jest | ||
| mix | ||
| mocha | ||
| node | ||
| rxjs | ||
| testing | ||
| zone-spec | ||
| BUILD.bazel | ||
| zone-global.d.ts | ||
| zone.api.extensions.ts | ||
| zone.configurations.api.ts | ||
| zone.ts | ||