axios-mock-adapter icon indicating copy to clipboard operation
axios-mock-adapter copied to clipboard

Axios adapter that allows to easily mock requests

Results 117 axios-mock-adapter issues
Sort by recently updated
recently updated
newest added

I have a config file that tells me whether API should use mock or not. Based on the configuration it should switch between Axios or Axios mock. ``` const MOCK_CONFIG...

When calling networkError, the error returned by the lib should define a request attribute. This is how axios works. It's important because error handling rely on the error.response check. Such...

major-version-candidate

I was attempting to write a unit test for a React hook and I've been unable to determine why networkError is caught in the methods onGet, onPatch, and onDelete but...

Hi there, Thanks for the great package! Just a quick question - it seems that it's not currently possible to `.reply` or `.replyOnce` to a POST request containing specific URL...

Would be great to export other types defined in https://github.com/ctimmerm/axios-mock-adapter/blob/master/types/index.d.ts This would make them directly accessible to the application. Currently I'm working around like this, but it's unnecessarily convoluted: ```...

I have simple Vue component that fetches API key when it is created and key can be renewed by clicking on button: {{data.api_key}} refresh export default { created() { axios.get(this.url).then((response)...

It looks like the #settle method is hijacking thrown errors with "Request failed with status code" text. https://github.com/ctimmerm/axios-mock-adapter/blob/master/src/utils.js#L98 Maybe there is a better way to approach this on our end?...

## What is the current behavior? In the code below, the *"mock.onGet without trailing slash"* test fails. ```javascript import axios from 'axios'; import MockAdapter from 'axios-mock-adapter' class Foo { constructor(endpoint)...

major-version-candidate

It will be good if we can change axios config at onGet, onPost, or etc, like ```js mock.onGet('/testPreviewImage', undefined, undefined, { baseURL: 'test' } ).reply((request) => [200, testPreviewImage]) ``` When...

`mock.onGet('/api').reply(200, '{"test": 5}')` `response.data` is a JS object that looks like `{test: 5}` instead of a string. Is there any way to force the response to be a string?

test