|
|
|
|
|
by zackify
2344 days ago
|
|
I would rather make a component that takes data as props. Now make a component on top that runs a network request and injects the network response into it. Now you have a reusable component independent of the api. Your network function can be tested individually. Your top level component doesn’t need testing as that is the part that would be mocked. You can now test your actual component without any mocking. If you need some dummy data to show before the backend team is ready, this is trivial. Guess I’m just not a Big enough mocking fan to ever need a library for what is such a small thing in my experience |
|