Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mock): matching the complete header list when using fetch #1301

Merged
merged 1 commit into from Mar 23, 2022
Merged

fix(mock): matching the complete header list when using fetch #1301

merged 1 commit into from Mar 23, 2022

Conversation

panva
Copy link
Member

@panva panva commented Mar 23, 2022

Fixes the ability to match a mock on the complete header when using fetch. This ability was introduced in v4.16.0, specifically #1275.

The issue is in the fact that when using fetch the matcher argument is not a plain object but rather HeadersList.

@codecov-commenter
Copy link

codecov-commenter commented Mar 23, 2022

Codecov Report

Merging #1301 (a925816) into main (a15bef3) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1301      +/-   ##
==========================================
+ Coverage   94.14%   94.16%   +0.01%     
==========================================
  Files          44       45       +1     
  Lines        4100     4112      +12     
==========================================
+ Hits         3860     3872      +12     
  Misses        240      240              
Impacted Files Coverage Δ
lib/mock/mock-utils.js 100.00% <100.00%> (ø)
lib/fetch/response.js 84.86% <0.00%> (-7.56%) ⬇️
lib/pool-base.js 96.77% <0.00%> (-0.98%) ⬇️
lib/fetch/body.js 98.33% <0.00%> (-0.84%) ⬇️
lib/client.js 97.93% <0.00%> (-0.11%) ⬇️
lib/agent.js 100.00% <0.00%> (ø)
lib/proxy-agent.js 100.00% <0.00%> (ø)
lib/fetch/headers.js 100.00% <0.00%> (ø)
lib/fetch/constants.js 100.00% <0.00%> (ø)
lib/dispatcher-base.js 98.71% <0.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a15bef3...a925816. Read the comment docs.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@ronag ronag merged commit 65feb05 into nodejs:main Mar 23, 2022
KhafraDev pushed a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
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.

None yet

4 participants