Solution 1:

You are correct that you would need to mock all subfunctions, also clone.

But you are also correct that you should not need to clone the data from fetch. Your syntax seems to be a little bit off, and you are not returning the json from your function.

Try this

fetch(url)
    .then((response) => response.json())
    .then((json) => {
        //updates a state from `useState`
        setResponse(json);
    });