Open TrueWill opened 6 years ago
I'm trying to mock this code:
axiosInstance .request(originalRequest) .then(...);
Where originalRequest is an object like:
originalRequest
{ headers: { }, baseURL: 'http://localhost:3000/test', method: 'get', url: '/test' }
This is supported by axios but results in "Network Error" (that is, passed through to axios) when mocked.
One workaround is to use and mock the default axios instance; then calls to request can be mocked.
request
I'm trying to mock this code:
Where
originalRequest
is an object like:This is supported by axios but results in "Network Error" (that is, passed through to axios) when mocked.