Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit fixes #6.
***** EDIT ****
Addressing 1 below: I am now typecasting transformResponse from the axios.defaults so the function I wrote is no longer included. Addressing 2-4 below: I removed the integration test in favor of unit testing. So logs are gone and questions about tests are in regards to an integration test that is no longer in this PR.
There's a couple of things that should be noted/addressed before merging:
AxiosTransformer | AxiosTransformer[] | undefined
. This means that I wrote a function to pull out the default transformer and always return it as AxiosTransformer[]. That seems a bit overkill but the other option was to type cast it as AxiosTransformer[] or rewrite the above function ourselves.#makeRequest
. I don't know if this is the best way to do it but I'm happy to change it if needed. If you have suggestions on how to effectively test thattransformResponse
returns JSON if the response is stringified JSON with Sinon or Chai, let me know.done()
to tell the test runner it's completed. However, when this test fails, it times out and I'm unsure where to catch the error to calldone(error)
. Any ideas?Thanks!