Skip to content

refactor(testing): remove withResolvers polyfill, use native method - #5427

Merged
svozza merged 2 commits into
mainfrom
chore/remove-with-resolvers-polyfill-5411
Jul 8, 2026
Merged

svozza merged 2 commits into
mainfrom
chore/remove-with-resolvers-polyfill-5411

Conversation

@dreamorosi

Copy link
Copy Markdown
Contributor

Summary

Removes the withResolvers() polyfill from @aws-lambda-powertools/testing-utils in favor of the native Promise.withResolvers static method. The polyfill's own doc comment marked it as temporary, to be removed once Node.js 20 support was dropped — which has now happened (supported runtimes are Node.js 22 and 24, where the native method is available). Since testing-utils is a private, internal-only package, there is no customer-facing change.

Changes

  • Replace the internal usages of the polyfill in the sequence() utility with native Promise.withResolvers<void>() (packages/testing/src/helpers.ts)
  • Remove the withResolvers function and its doc comment from packages/testing/src/helpers.ts
  • Remove the withResolvers export from packages/testing/src/index.ts
  • Verified no other usages remain across the monorepo; testing package builds and its unit tests pass, and a sequence() consumer (logger concurrency unit tests) passes

Issue number: closes #5411


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

The withResolvers helper was a polyfill for Promise.withResolvers,
needed only while the project supported Node.js 20. Now that the
minimum supported runtime is Node.js 22, where the static method is
natively available, replace the internal usage in sequence() with
Promise.withResolvers and drop the polyfill and its export.

Fixes #5411
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added size/M PR between 30-99 LOC and removed size/M PR between 30-99 LOC labels Jul 8, 2026
@svozza
svozza merged commit df98f94 into main Jul 8, 2026
41 checks passed
@svozza
svozza deleted the chore/remove-with-resolvers-polyfill-5411 branch July 8, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M PR between 30-99 LOC

2 participants