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: Make ResponseWrapper an instance of Response #2889

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FrederikBolding
Copy link
Member

Makes ResponseWrapper extend Response so that instanceof checks do not fail on responses from fetch.

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.48%. Comparing base (0b19875) to head (22c0fb0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2889   +/-   ##
=======================================
  Coverage   94.48%   94.48%           
=======================================
  Files         486      486           
  Lines       10397    10399    +2     
  Branches     1594     1594           
=======================================
+ Hits         9824     9826    +2     
  Misses        573      573           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -7,7 +7,7 @@ import type { EndowmentFactoryOptions } from './commonEndowmentFactory';
* This class wraps a Response object.
* That way, a teardown process can stop any processes left.
*/
class ResponseWrapper implements Response {
export class ResponseWrapper extends Response {
Copy link
Member Author

Choose a reason for hiding this comment

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

Devs can still access the underlying Response by using the prototype chain. We'll need to fix that before merging.

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.

1 participant