Skip to content

test: drop undici, use a small node:http(s) helper - #128

Closed
Puppo wants to merge 1 commit into
fastify:mainfrom
Puppo:undici-upgrade
Closed

Puppo wants to merge 1 commit into
fastify:mainfrom
Puppo:undici-upgrade

Conversation

@Puppo

@Puppo Puppo commented Aug 2, 2026 •

Copy link
Copy Markdown
Member

Drops undici as a devDependency and replaces the test HTTP client with a small test/helpers/request.js wrapper around node:http / node:https. This unblocks the queued dependabot PRs (#112, #116, #118, #121, #122) that have all been failing on Node 20 because undici@8.x requires Node >=22.10.0 (it uses worker_threads.markAsUncloneable, which landed in 22.10).

@Puppo Puppo changed the title test: replace undici with built-in fetch test: drop undici, use a small node:http(s) helper Aug 2, 2026
@Puppo
Puppo marked this pull request as ready for review August 2, 2026 16:00
undici@8.x requires Node.js >=22.10 (it uses
worker_threads.markAsUncloneable, added in 22.10.0), which breaks
the test suite on Node 20 (see dependabot PRs fastify#112, fastify#116, fastify#118,
fastify#121, fastify#122). The package only uses undici as a test HTTP client -
nothing in the runtime depends on it - so the dependency is
removed entirely.

A small test/helpers/request.js wrapper around node:http and
node:https keeps the existing test code shape (request(url) ->
res.body.json()) and scopes self-signed-cert acceptance to the
HTTPS path via a per-request https.Agent({ rejectUnauthorized:
false }), with no process-level side effects.
@mcollina

Copy link
Copy Markdown
Member

what's the problem in keeping undici 7?

@Puppo

Puppo commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

what's the problem in keeping undici 7?

The only problem is that we cannot upgrade to undici 8 because it is not Node 20 compatible.
But if it is fine, I can close the PR.

@Puppo Puppo closed this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants