Jest test asyn backend call
mocked(callToBackend).mockResolvedValue({key: value})
expect(callToBackend).toBeCalledTimes(1);
const Test = () => {
useEffect(() => {
callToBackend()
.then(response => console.log("The call was made"))
.catch(error => console.error("Hey something wrong happened"))
}, []};
return (
<h1>TEST</h1>
);
};