Open sekmo opened 2 years ago
Sorry, I just saw right now that I can use a function to process the response, so I guess that something like this would be the answer:
let amountOfCalledFetchMocks = 0
fetchMock.get('begin:http://test.test/', () => {
amountOfCalledFetchMocks++;
if(amountOfCalledFetchMocks == 1) {
return 400;
} else {
return 200;
}
});
Please let me know if you have a better solution, thanks :)
Hello everyone! Is it possible to mock 2 responses with the same method and URL, but making the first one returning a 400 and the second one a 200?