Sitelet https://github.com/angular/angular/pull/70592
Skip to content

refactor(core): use native Promise.withResolvers() in remaining tests - #70592

Merged
crisbeto merged 1 commit into
angular:mainfrom
MeAkib:refactor/drop-manual-deferred-promises-in-tests
Sep 9, 2026
Merged

crisbeto merged 1 commit into
angular:mainfrom
MeAkib:refactor/drop-manual-deferred-promises-in-tests

Conversation

@MeAkib

@MeAkib MeAkib commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #69739, applying the same change to the test suites that still hand-roll the deferred promise idiom: declaring an outer resolve/reject binding and capturing the executor arguments into it.

Also drops the last two stand-ins for the native API — the promiseWithResolvers import in resource_spec.ts and the local createPromise() helper in the router's bootstrap.spec.ts.

No configuration change is needed here: packages/tsconfig-build.json already lists es2024.promise, and zone.js implements withResolvers() on ZoneAwarePromise, so both the node and browser test targets pick the native API up.

@pullapprove
pullapprove Bot requested review from kirjs and rockymeza September 6, 2026 17:26
@angular-robot angular-robot Bot added area: core Issues related to the framework runtime requires: TGP This PR requires a passing TGP before merging is allowed labels Sep 6, 2026
@ngbot ngbot Bot added this to the Backlog milestone Sep 6, 2026
Replaces the remaining hand-rolled deferred promise implementations
with the native `Promise.withResolvers()` API and removes the now
unused helper and import.

Follow-up to angular#69739.
@MeAkib
MeAkib force-pushed the refactor/drop-manual-deferred-promises-in-tests branch from 670544c to 5c683e4 Compare September 6, 2026 17:40
@JeanMeche
JeanMeche requested review from JeanMeche and removed request for kirjs and rockymeza September 6, 2026 17:48
@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Sep 6, 2026
@crisbeto
crisbeto merged commit 1bc7e3c into angular:main Sep 9, 2026
23 of 25 checks passed
@crisbeto

crisbeto commented Sep 9, 2026

Copy link
Copy Markdown
Member

This PR was merged into the repository. The changes were merged into the following branches:

@MeAkib
MeAkib deleted the refactor/drop-manual-deferred-promises-in-tests branch October 22, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime requires: TGP This PR requires a passing TGP before merging is allowed target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants