integration testing and using mock?
Here's how I try to remember it. Integration means verifying that your code works with external dependencies. Now, if you want to make an API call, how you write your end of the call (like sending the data in correct format etc ..) these are under your control. So these are "integrations your code makes with outside" But, the API response might not be under your control. So you just need to MOCK it, fake the presence of that API. So, parts that aren't under your control need to be mocked and parts of your code that communicates with outside needs integration testing.
Обсуждают сегодня