Repository navigation
test: use Undici matching version bundled with Node.js - #970
Merged
Merged
Conversation
paulrobertlloyd
force-pushed
the
test/undici
branch
from
September 26, 2026 19:30
b625289 to
08f88a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests mocked HTTP requests using a
MockAgentfromundici@8, but CI runs on Node.js 24, whose built-infetch()is powered by Undici 7. Node.js doesn’t expose its bundled Undici, and dispatchers aren’t compatible across major versions (see nodejs/undici#5341), so tests were passing by luck rather than design.Changes
@indiekit-test/undicihelper, which installsundici@7andundici@8as aliases and re-exportsMockAgent,setGlobalDispatcheretc. from whichever matchesprocess.versions.undiciundicidependencyundicifrom being imported directlyfetch()intercepted byMockAgentkeeps response headers and decodes compressed bodies (the symptoms of a mismatch)Notes
When a future Node.js release bundles a new major version of Undici, add an alias to
helpers/undici/package.json. Until then, the helper throws with a message explaining what to do.