If I have a js file like:
const doSomething = async (obj, time) => {
// ...
};
const throttledDoSomething = (obj, time) => {
const throttleTime = time + SOME_DELTA_VALUE;
return throttle(() => doSomething(elem, time), throttleTime);
};
How can i mock the call for doSomething
when testing throttledDoSomething
in jest?
I saw this question that answers it for jasmine, but I would like to stick to using jest. Also if anyone has tips on best practices in situations like that, it would be appreciated.
Aucun commentaire:
Enregistrer un commentaire