angular/packages/zone.js/lib
Andrew Scott 99d679d606 feat(zone.js): Add 'flush' parameter option to fakeAsync to flush after the test (#57137)
From the internal issue on the matter:

> When using the standard Jasmine version of it promises returned by the body function are automatically awaited. The Catalyst version of it is fake-async, so awaiting the promise does not make sense; however it would be nice if Catalyst automatically flushed the promise to replicate the experience of using standard it. This would allow users to do the following:

```
it('should fail later', async () => {
  await new Promise(r => setTimeout(r));
  fail('failure');
});
```
> In Catalyst today the above test will pass. If this proposal to automatically flush the resulting promise were implemented it would fail.

Flushing after the tests complete has been the default behavior inside
Google since 2020. Very few tests remain that use the old behavior of
only flushing microtasks. The example above would actually fail with
`fakeAsync` due to the pending timer, but the argument still remains the
same. We might as well just flush if we're going to fail the test
anyways by throwing if there's no flush at the end.

PR Close #57137
2024-08-02 16:52:07 +00:00
..
browser refactor: migrate zone.js to prettier formatting (#55427) 2024-04-29 09:52:05 -07:00
common fix(zone.js): support Timeout.refresh in Node.js (#56852) 2024-07-16 12:46:51 -07:00
extra refactor: migrate zone.js to prettier formatting (#55427) 2024-04-29 09:52:05 -07:00
jasmine refactor: migrate zone.js to prettier formatting (#55427) 2024-04-29 09:52:05 -07:00
jest refactor: migrate zone.js to prettier formatting (#55427) 2024-04-29 09:52:05 -07:00
mix refactor(zone.js): update Zone bundles to call patch* functions (#53443) 2024-03-15 18:11:33 -07:00
mocha refactor: migrate zone.js to prettier formatting (#55427) 2024-04-29 09:52:05 -07:00
node fix(zone.js): add missing APIs to Node.js fs patch (#54396) 2024-05-03 08:03:25 -07:00
rxjs refactor: migrate zone.js to prettier formatting (#55427) 2024-04-29 09:52:05 -07:00
testing refactor: migrate zone.js to prettier formatting (#55427) 2024-04-29 09:52:05 -07:00
zone-spec feat(zone.js): Add 'flush' parameter option to fakeAsync to flush after the test (#57137) 2024-08-02 16:52:07 +00:00
BUILD.bazel refactor(zone.js): package Zone *.d.ts files (#53443) 2024-03-15 18:11:34 -07:00
zone-global.d.ts fix(zone.js): remove global declaration (#37861) 2020-10-23 15:19:49 -07:00
zone-impl.ts fix(zone.js): support Timeout.refresh in Node.js (#56852) 2024-07-16 12:46:51 -07:00
zone.api.extensions.ts refactor(zone.js): change from scripts to modules (#53445) 2024-01-09 13:20:50 -08:00
zone.configurations.api.ts fix(zone.js): allow enabling default beforeunload handling (#55875) 2024-06-12 13:06:21 -07:00
zone.ts refactor: migrate zone.js to prettier formatting (#55427) 2024-04-29 09:52:05 -07:00