Axios-mock-adapter giving Promise { _x: 0, _y: 0, _z: null, _A: null } when mocking the axios in react-native

264 views Asked by At

I want to mock the Axios API in react-native and use axios-mock-adapter to mock the API. Below is the code.

const axiosMock = new MockAdapter(axios);
console.log("axiosMock ==>", axiosMock);

But when I run the test the axiosMock gives me a promise and I cannot mock the API

console.log
    axiosMock ==> Promise { _x: 0, _y: 0, _z: null, _A: null }

Can anyone help me to solve this issue?

0

There are 0 answers