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: allow optional body for mock reply #1536

Merged
merged 1 commit into from Jul 10, 2022
Merged

Conversation

JustinBeckwith
Copy link
Contributor

@JustinBeckwith JustinBeckwith commented Jul 10, 2022

Quick quality of life fix. The reply method today on the mock interceptor requires both an HTTP status code and a body to send. In a lot of cases, it's common to mock out an empty body. Trying to make this as smooth as nock by defaulting the body to '' :)

@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2022

Codecov Report

Merging #1536 (1cb06f0) into main (c1a0490) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1536      +/-   ##
==========================================
- Coverage   94.90%   94.87%   -0.03%     
==========================================
  Files          50       50              
  Lines        4608     4609       +1     
==========================================
  Hits         4373     4373              
- Misses        235      236       +1     
Impacted Files Coverage Δ
lib/mock/mock-interceptor.js 98.66% <100.00%> (-1.34%) ⬇️
lib/fetch/body.js 98.51% <0.00%> (-0.02%) ⬇️
lib/fetch/webidl.js 98.29% <0.00%> (+<0.01%) ⬆️
lib/fetch/util.js 82.35% <0.00%> (+0.17%) ⬆️

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 c1a0490...1cb06f0. 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

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