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

refactor(forms): extract shared promiseWithResolvers test helper to p… - #69686

Closed
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:extract-shared-promiseWithResolvers-test
Closed

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:extract-shared-promiseWithResolvers-test

Conversation

@MeAkib

@MeAkib MeAkib commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Move the duplicated promiseWithResolvers utility function from submit.spec.ts, debounce.spec.ts, form_field.spec.ts, interop.spec.ts, compat.spec.ts, and signal_form_control.spec.ts into packages/private/testing/src/utils.ts and replace all local definitions with an import from @angular/private/testing.

Fix call sites that resolve with a non-void value to use an explicit type parameter (e.g. promiseWithResolvers<boolean>()) to match the shared function's T = void default.

…rivate/testing

Move the duplicated `promiseWithResolvers` utility function from  submit.spec.ts, debounce.spec.ts, form_field.spec.ts, interop.spec.ts, compat.spec.ts, and signal_form_control.spec.ts into `packages/private/testing/src/utils.ts` and replace all local definitions with an import from `@angular/private/testing`.

Fix call sites that resolve with a non-void value to use an explicit  type parameter (e.g. `promiseWithResolvers<boolean>()`) to match the  shared function's `T = void` default.
@pullapprove
pullapprove Bot requested review from alan-agius4 and atscott July 8, 2026 18:49
@ngbot ngbot Bot added this to the Backlog milestone Jul 8, 2026
* Replace with `Promise.withResolvers()` once it's available.
* NET September 2026
*
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promise.withResolvers() is already available in node version used by this repo, as it's available since node v22. So we could use native one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

@alan-agius4

Copy link
Copy Markdown
Contributor

Thanks for making this change. Since Promise.withResolvers() is available natively now, we should use that instead of introducing a new utility.

@MeAkib

MeAkib commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@JeanMeche @alan-agius4

Can we proceed with this, since we're not moving forward with #69739?

@angular-automatic-lock-bot

Copy link
Copy Markdown

This pull request has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Aug 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants