4 ms·
When you are “mocking” services that involve really doing network requests your tests are going to slow down dramatically and that is a problem because you run
by PaulHoule 3y ago
When you are “mocking” services that involve really doing network requests your tests are going to slow down dramatically and that is a problem because you run so many so often.
His diagrams miss how bad the problem is because it is not that client code is calling 20 different external servers but that something “simple” (a react component fetching a JSON document and drawing it) involves react calling your code multiple times. Then there is the deep asynchrony of an application that really is a message broker, where an email gets sent from here and received there.
When you are in control you really can break it all up into functions but I still don’t have an answer I like for writing tests in React other than “prop drilling”.