angular/packages/core/test/render3
Andrew Scott 06be8034bb fix(core): Microtask scheduling should be used after any application synchronization
Previously, Angular would switch from the macrotask to a microtask
scheduler _only_ when the scheduler was the trigger for the
synchronization. This microtask scheduling is to ensure patterns such as
`Promise.resolve().then(() => updateAppStateAgain())` _during_
synchronization are caught and synchronized again within the same event
loop (guaranteeing that they aren't split across multiple browser paints).

The microtask scheduler should be used after any tick, not just from
those than run within the scheduler to always account for the promises
within synchronization. This is encountered most frequently during
bootstrap, which triggers the tick directly.

In this change we exempt `TestBed.tick` and
`ComponentFixture.detectChanges` from this behavior. Doing so would affect
the timing of stability and tests are quite sensitive to this (e.g.
`fixture.whenStable`). It is somewhat unfortunate that we have "special" test-only
behavior. However, it is important to acknowledge that this only affects
the test-only APIs as well. Any code in the application under test that
triggers `ApplicationRef.tick` directly would still use the microtask
scheduling behavior.

fixes #65444
2025-12-16 13:34:48 -08:00
..
i18n fix(core): Clear lView from IcuIteratorState when stack is empty to prevent memory leak 2025-10-27 19:42:18 +01:00
instructions refactor(core): stop producing ng-reflect attributes by default (#60973) 2025-04-24 10:07:35 -07:00
interfaces refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
ivy build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
jit perf(compiler): chain query creation instructions 2025-12-09 09:24:36 -08:00
styling_next refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
util refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
BUILD.bazel build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
change_detection_spec.ts fix(core): Flush animations when no component has been checked (#58089) 2025-04-09 11:12:54 -07:00
component_ref_spec.ts refactor: clean up explicit standalone flags from tests (#63963) 2025-09-22 14:27:34 +00:00
deps_tracker_spec.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
di_spec.ts refactor(core): stop producing ng-reflect attributes by default (#60973) 2025-04-24 10:07:35 -07:00
es2015-tsconfig.json fix(core): destroy hooks not set up for useClass provider using forwardRef (#44281) 2021-11-30 11:56:05 -05:00
global_utils_spec.ts feat(core): add utility for resolving defer block information to ng global (#59184) 2024-12-16 10:26:43 -08:00
i18n_debug_spec.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
imported_renderer2.ts refactor(platform-browser): remove unused Platform ID dependency from DomRendererFactory2 2025-11-06 12:00:46 -08:00
instructions_spec.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
integration_spec.ts refactor(compiler): remove unnecessary sanitization for safe attributes 2025-12-15 14:13:38 -08:00
is_shape_of.ts refactor(forms): support custom control directives 2025-11-24 13:48:17 -05:00
is_shape_of_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
jit_environment_spec.ts refactor(core): remove unused type 2025-11-12 13:13:48 -08:00
list_reconciliation_spec.ts fix(core): ensure @for iteration over field is reactive (#64113) 2025-10-24 09:29:29 +02:00
load_domino.ts build: migrate all ts_library in packages/core/test (#61472) 2025-05-20 10:00:43 +00:00
matchers.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
matchers_spec.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
metadata_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
multi_map_spec.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
node_selector_matcher_spec.ts refactor(core): simplify attributes extraction logic for ComponentRef (#59678) 2025-01-27 13:15:21 +01:00
providers_helper.ts refactor: clean up explicit standalone flags from tests (#63963) 2025-09-22 14:27:34 +00:00
providers_spec.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
query_spec.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
reactive_safety_spec.ts refactor(core): Update tests for zoneless by default (#63668) 2025-09-09 14:41:56 -07:00
reactivity_spec.ts fix(core): Microtask scheduling should be used after any application synchronization 2025-12-16 13:34:48 -08:00
testing_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
utils.ts docs: set syntax highlighting of code examples MD code blocks (#59026) 2024-12-04 17:30:28 +01:00
view_fixture.ts build: migrate all ts_library in packages/core/test (#61472) 2025-05-20 10:00:43 +00:00
view_utils_spec.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00