angular/packages/zone.js/lib
JiaLiPassion dea7234a76 fix(zone.js): async-test should only call done once (#45025)
`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
2022-02-09 10:18:56 -08:00
..
browser fix(zone.js): should continue to executue listeners when throw error (#41562) 2021-04-21 15:54:08 -07:00
closure fix(zone.js): fix typo in zone_externs (#40348) 2021-01-08 09:47:46 -08:00
common build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
extra build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
jasmine feat(core): support TypeScript 4.3 (#42022) 2021-06-04 11:17:09 -07:00
jest refactor(zone.js): rename several internal apis in fake async zone spec (#39127) 2020-10-13 15:56:22 -07:00
mix build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
mocha build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
node fix(zone.js): should continue to executue listeners when throw error (#41562) 2021-04-21 15:54:08 -07:00
rxjs fix(zone.js): zone patch rxjs should return null _unsubscribe correctly. (#37091) 2020-07-27 12:10:27 -07:00
testing refactor(core): remove unused fakeAsyncFallback and asyncFallback (#37879) 2020-11-20 08:34:59 -08:00
zone-spec fix(zone.js): async-test should only call done once (#45025) 2022-02-09 10:18:56 -08:00
BUILD.bazel build: upgrade angular build, integration/bazel and @angular/bazel package to rule_nodejs 2.2.0 (#39182) 2020-10-08 11:54:59 -07:00
zone-global.d.ts fix(zone.js): remove global declaration (#37861) 2020-10-23 15:19:49 -07:00
zone.api.extensions.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
zone.configurations.api.ts feat(zone.js): monkey patches queueMicrotask() (#38904) 2020-11-05 11:23:33 -08:00
zone.ts build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00