Skip to content

Add fetch support with axios #223

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

suhaotian
Copy link

Since Axios v1.7.0, Axios supports the fetch adapter.

In this PR, we bump the Axios version to the latest and add a fetch option, so when we want to use fetch, we need to pass true as the second parameter like new SMSAPI('token', true).

The unit test issues here have no effect, because default is use http adapter, but Nock doesn't support fetch and only supports the http module.

@suhaotian
Copy link
Author

Fix #220

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