-
Notifications
You must be signed in to change notification settings - Fork 21
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
Replace axios with native fetch #564
Conversation
a04cd9e
to
b2b9205
Compare
axios.get.mockResolvedValue({ | ||
data: ` | ||
fetch.mockResolvedValue({ | ||
text: async () => ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok this looked weird but i looked at the whole file in context and figured it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a comment that it needs to be formatted like yaml so maybe it looks weird to the next person. Would that help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think it's necessary, it was easy enough to see when i opened the file!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple small questions but nothing blockin! nice work.
.then((response) => { | ||
if (response && response.status) { | ||
if (response?.ok && response.status) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh i didn't know js had a null-chaining operator!
"https://www.opm.gov/json/operatingstatus.json", | ||
); | ||
if (status !== 200) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] can we get rid of this error throw because data
is more consistent now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
Axios doesn't really provide us much benefit over native fetch, so yoink it out and that's one less dependency to worry about!
Will update dev documentation just prior to merging.
Checklist:
The OAuth wiki page has been updated if Charlie needs any new OAuth events or scopesThe Environment Variables wiki page has been updated if new environment variables were introduced or existing ones changedlocal development processes have changedmajor development workflows have changedinternal utilities or APIs have changedIf appropriate, the NIST 800-218 documentation has been updated