Testing api call errors
I’m using axios-mock-adapter to mock api calls made using axios in a vitest test suite with react-testing-library. Since I’m using axios to make api calls in my application, I’ve rendered toast.error(“Server is offline or unreachable”) for any error that does not have a response where toast is imported from react-hot-toast. I want to test the api error (response and bad request / network error).