angular/packages
Andrew Scott 70e8b40750 fix(zone.js): Update the default behavior of fakeAsync to flush after the test (#57240)
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.

BREAKING CHANGE: `fakeAsync` will now flush pending timers at the end of
the given function by default. To opt-out of this, you can use `{flush:
false}` in options parameter of `fakeAsync`

PR Close #57240
2024-08-05 20:24:54 +00:00
..
animations docs(docs-infra): Use shiki for code highlighting (#57059) 2024-07-24 10:24:51 -07:00
bazel refactor(docs-infra): complete removal of aio directory (#56496) 2024-06-18 12:26:00 -07:00
benchpress refactor(docs-infra): complete removal of aio directory (#56496) 2024-06-18 12:26:00 -07:00
common refactor(docs-infra): migrate api-gen from dev-infra into the repo (#57241) 2024-08-05 17:06:29 +00:00
compiler Revert "fix(compiler): reduce chance of conflicts between generated factory and local variables (#57181)" (#57230) 2024-08-01 19:33:04 +00:00
compiler-cli fix(compiler-cli): support JIT transforms before other transforms modifying classes (#57262) 2024-08-05 14:45:19 +00:00
core fix(zone.js): Update the default behavior of fakeAsync to flush after the test (#57240) 2024-08-05 20:24:54 +00:00
docs/di docs: remove outdated/unsupported webworker doc (#49856) 2023-04-17 14:01:41 +00:00
elements refactor(docs-infra): complete removal of aio directory (#56496) 2024-06-18 12:26:00 -07:00
examples refactor: migrate docs, examples, private, service worker and upgrade to prettier formatting (#54163) 2024-01-30 20:08:40 +00:00
forms refactor(forms): Update status, touched, and pristine to use private setter (#56573) 2024-06-26 08:47:39 -07:00
language-service fix(language-service): avoid generating TS suggestion diagnostics for templates (#56241) 2024-08-02 15:51:35 +00:00
localize refactor(docs-infra): migrate api-gen from dev-infra into the repo (#57241) 2024-08-05 17:06:29 +00:00
misc/angular-in-memory-web-api build: bump in-memory-web-api to v18 (#56018) 2024-05-23 12:00:29 +02:00
platform-browser refactor(docs-infra): migrate api-gen from dev-infra into the repo (#57241) 2024-08-05 17:06:29 +00:00
platform-browser-dynamic refactor(docs-infra): complete removal of aio directory (#56496) 2024-06-18 12:26:00 -07:00
platform-server fix(core): hydration error in some let declaration setups (#57173) 2024-07-30 16:43:46 +00:00
private/testing refactor(docs-infra): remove reliance on aio example macro (#56496) 2024-06-18 12:25:59 -07:00
router feat(router): Add defaultQueryParamsHandling to router configuration (#57198) 2024-08-02 15:11:38 +00:00
service-worker docs: update broken link to version updates in versionEvent (#56870) (#56870) 2024-07-19 13:41:54 -07:00
upgrade refactor(docs-infra): complete removal of aio directory (#56496) 2024-06-18 12:26:00 -07:00
zone.js fix(zone.js): Update the default behavior of fakeAsync to flush after the test (#57240) 2024-08-05 20:24:54 +00:00
BUILD.bazel refactor(docs-infra): migrate api-gen from dev-infra into the repo (#57241) 2024-08-05 17:06:29 +00:00
circular-deps-test.conf.js ci: complete migration to prettier formatting (#55580) 2024-04-29 14:00:16 -07:00
empty.ts
goog.d.ts
license-banner.txt build: update licence date. (#55129) 2024-04-08 11:31:12 -07:00
README.md
system.d.ts
tsconfig-build.json build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
tsconfig-legacy-saucelabs.json feat(core): support TypeScript 5.5 (#56096) 2024-05-29 15:33:33 +02:00
tsconfig-test.json
tsconfig-tsec-base.json refactor(core): throw an error when hydration marker is missing from DOM (#51170) 2023-08-04 11:31:49 -04:00
tsconfig.json refactor(router): Update integration tests to cover navigation and history API (#53799) 2024-01-30 15:04:02 +00:00
tsec-exemption.json fix(core): hardening attribute and property binding rules for <iframe> elements (#47964) 2022-11-09 00:47:56 -08:00
types.d.ts build: update to jasmine 4.0 (#45558) 2022-04-11 16:25:28 +00:00

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT