angular/packages/zone.js/test/common
arturovt 260d3ed0d9 fix(zone.js): patch Response methods returned by fetch (#50653)
This commit updates the implementation of the `fetch` patch and additionally
patches `Response` methods which return promises. These are `arrayBuffer`, `blob`,
`formData`, `json` and `text`. This fixes the issue when zone becomes stable too early
before all of the `fetch` tasks complete. Given the following code:
```ts
appRef.isStable.subscribe(console.log);
fetch(...).then(response => response.json()).then(console.log);
```
The `isStable` observer would log `false, true, false, true`. This was happening because
`json()` was returning a native promise (and not a `ZoneAwarePromise`). But calling `then`
on the native promise returns a `ZoneAwarePromise` which notifies Angular about the task
being scheduled and forces to re-calculate the `isStable` state.

Issue: #50327

PR Close #50653
2024-01-31 14:57:25 +00:00
..
Error.spec.ts refactor: update zone.js and tests to work with ESM (#48521) 2022-12-19 19:50:44 +00:00
fetch.spec.ts fix(zone.js): patch Response methods returned by fetch (#50653) 2024-01-31 14:57:25 +00:00
microtasks.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
promise-disable-wrap-uncaught-promise-rejection.spec.ts fix(zone.js): disable wrap uncaught promise rejection should handle primitive value (#38476) 2020-09-24 11:32:44 -04:00
Promise.spec.ts feat(zone.js): implement Promise.withResolvers() (#53514) 2023-12-12 09:04:44 -08:00
queue-microtask.spec.ts fix(zone.js): enable monkey patching of the queueMicrotask() API in node.js (#50530) 2023-06-07 12:42:33 -07:00
setInterval.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
setTimeout.spec.ts fix(zone.js): clearTimeout/clearInterval should call on object global (#37858) 2020-07-24 15:22:47 -07:00
task.spec.ts refactor(router): run spell check on router package (#50445) 2023-05-24 13:56:56 +00:00
toString.spec.ts fix(zone.js): zone.js toString patch should check typeof Promise is function (#38350) 2020-08-25 09:51:50 -07:00
util.spec.ts refactor(zone.js): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:16 -07:00
zone.spec.ts build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00