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

in my testcase, i rendered a react component called AdLog, which will do axios query in componentDidMount. i have wrote several testcases, 1. Should render agent log success => not...

Release of v1.18.0 causes tests using `FormData` with post requests to fail. It seems as of 1.18.0 `onPost` with an expected data of `FormData` returns a 404 instead of whatever...

I tried to use await Promise.all with .map to call the api with multi different params. And when try to mock the response, the mock replies two same results with...

Mocking the default instance of axios (`new MockAdapter(axios)`) will affect any axios instances subsequently created (`axios.create()`). I'm not sure that I'd call this a bug, but it's definitely surprising behavior;...

I want to match against an expected string body (requiredBody) rather than a JSON object because I want to verify that my `transformData` functions are working as intended. Matching against...

Enhanced Axios errors have a `.toJSON()` method to facilitate serialization: https://github.com/axios/axios/pull/1625

Whole response of axios contains statusText ``` { // `data` is the response that was provided by the server data: {}, // `status` is the HTTP status code from the...

major-version-candidate

I have a few libraries split out as sort of a monorepo. Each library has it's own mocks that I want to register, so each does a `const mockApi =...

I have a component that makes an API call to get token and stores it if the call is successful, or shows an error to the user otherwise. I'm mocking...

If I reply with a `set-cookie` I expect `document.cookie` to be updated within a browser or fake-DOM environment, like Jest/jsdom.