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

feat: add support for request params in mock client #1466

Merged
merged 5 commits into from May 26, 2022

Conversation

kibertoad
Copy link
Contributor

refs #1448

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.

good work! Docs are missing!

@kibertoad
Copy link
Contributor Author

@mcollina Done!

@kibertoad kibertoad requested a review from mcollina May 26, 2022 08:08
@codecov-commenter
Copy link

codecov-commenter commented May 26, 2022

Codecov Report

Merging #1466 (72d032d) into main (6855006) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1466   +/-   ##
=======================================
  Coverage   94.52%   94.52%           
=======================================
  Files          49       49           
  Lines        4271     4276    +5     
=======================================
+ Hits         4037     4042    +5     
  Misses        234      234           
Impacted Files Coverage Δ
lib/mock/mock-interceptor.js 100.00% <100.00%> (ø)
lib/mock/mock-utils.js 100.00% <100.00%> (ø)

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 6855006...72d032d. Read the comment docs.

@kibertoad kibertoad closed this May 26, 2022
@kibertoad kibertoad reopened this May 26, 2022
@kibertoad kibertoad closed this May 26, 2022
@kibertoad kibertoad reopened this May 26, 2022
@kibertoad kibertoad closed this May 26, 2022
@kibertoad kibertoad reopened this May 26, 2022
@@ -50,6 +50,8 @@ declare namespace MockInterceptor {
body?: string | RegExp | ((body: string) => boolean);
/** Headers to intercept on. */
headers?: Record<string, string | RegExp | ((body: string) => boolean)> | ((headers: Record<string, string>) => boolean);
/** Query params to intercept on */
query?: Record<string, any>;
Copy link
Member

Choose a reason for hiding this comment

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

please add a test for this type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@kibertoad kibertoad requested a review from mcollina May 26, 2022 11:17
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

@mcollina mcollina merged commit fab1e8b into nodejs:main May 26, 2022
@kibertoad kibertoad deleted the feat/mock-request-params branch May 26, 2022 14:23
@kibertoad
Copy link
Contributor Author

@mcollina Thank you! Would it be feasible to release a new version next week? New query param functionality is not very compatible with tests without this piece.

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

3 participants