3 ms·
> But still, in that case I'm not sure why you'd need to mock <PeskyChild>. Not every child is a pesky one; but suppose it makes a network request, or tries to
by azangru 4y ago
> But still, in that case I'm not sure why you'd need to mock <PeskyChild>.
Not every child is a pesky one; but suppose it makes a network request, or tries to read something from IndexedDB, or relies on window.matchMedia or IntersectionObserver. And you don't want to deal with this stuff when you are testing one of its (grand)parents.
- Vinnl 4y agoYeah exactly, that's what I was alluding to before about only mocking the hook/function that performs those side effects. But I guess if mocking modules will no longer be possible (still haven't seen why that should happen), that will still be problematic too.