We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
i have the following code in my program:
return fetchFromMock(src, fetchingOptions) .catch(() => fetchFromNetwork(src, fetchingOptions))
for every "resource" in my application, i decide in build time if it should be mocked or not.
so i'm ok with fetchFromMock fails.
fetchFromMock
now, for some reason, when axios-mock-adapter fails, chrome enters debugging mode instead of just moving on to the "catch" function
axios-mock-adapter
i'd like a way to prevent this.
The text was updated successfully, but these errors were encountered:
Can you show what the fetchFromMock implementation looks like?
Sorry, something went wrong.
export function fetchFromMock(src, {responseType}) { return axiosInstance.get( URI(src).filename(), {responseType} )) .then(res => res.data) }
and this is how the mock is created
function mock(zip) { return Promise.all(values(zip.files).map(addFileToAdapter)) } function addFileToAdapter(file) { const name = file.name const reader = getFileExtension(name) === 'svg' ? 'text' : 'blob' return file.async(reader).then(data => { return adapter.onGet(name).reply(200, data) }) }
No branches or pull requests
i have the following code in my program:
for every "resource" in my application, i decide in build time if it should be mocked or not.
so i'm ok with
fetchFromMock
fails.now, for some reason, when
axios-mock-adapter
fails, chrome enters debugging mode instead of just moving on to the "catch" functioni'd like a way to prevent this.
The text was updated successfully, but these errors were encountered: