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

use native fetch (if available) #585

Closed
wants to merge 2 commits into from

Conversation

aarongranick-okta
Copy link
Contributor

@aarongranick-okta aarongranick-okta commented Jan 8, 2021

This bypasses the cross-fetch module when native fetch is available

@aarongranick-okta aarongranick-okta marked this pull request as ready for review January 8, 2021 21:37
@codecov-io
Copy link

codecov-io commented Jan 8, 2021

Codecov Report

Merging #585 (aaee9cf) into master (56489f9) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #585   +/-   ##
=======================================
  Coverage   92.98%   92.98%           
=======================================
  Files          38       38           
  Lines        2167     2168    +1     
  Branches      454      455    +1     
=======================================
+ Hits         2015     2016    +1     
  Misses        152      152           
Impacted Files Coverage Δ
lib/fetch/fetchRequest.ts 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 56489f9...aaee9cf. Read the comment docs.

@@ -52,7 +52,7 @@ function fetchRequest(method: string, url: string, args: FetchOptions) {
if (contentType === 'application/json' && body && typeof body !== 'string') {
body = JSON.stringify(body);
}

var fetch = global.fetch || crossFetch;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a test to make sure global fetch is called if fetch is defined else crossFetch is called.

Copy link
Contributor

@magizh-okta magizh-okta left a comment

Choose a reason for hiding this comment

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

🏅

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.

5 participants