Adding interceptors to axios instances #2
Closed
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 is WIP. Creating PR to get some feedback.
I am interested in using
axios-vcr
in my tests, but I useaxios
instances. I am proposing adding a second parameter toVCR.mountCassette
with options, being the first one in this caseinstance
I am defaulting to
require('axios')
for backwards compatibility. As far as I can see, the change do not break current tests, but I have duplicated the main test file to test against my instance and found a few issues:axios
and and instance? I don't like the duplication that testing both options would bring. The current new test file is just a work in progress and I hope we can find a better wayVCR
configuration to avoid adding the options on every test.I hope you can have a look at this in case I am missing something, specially with the failing (skipped) case.
EDIT: some typos