Open vzaidman opened 6 years ago
Can you show what the fetchFromMock
implementation looks like?
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)
})
}
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.