If you mock, are you even testing?

Which is why you have various types of tests, including E2E working on actual live dependencies if at all possible.

Using live third-party systems makes your tests slow (processing time on the third-party side + cleanup of whatever your tests created), flaky (non-prod environments are rarely stellar in terms of stability), of limited use for regression testing (you can't test edge conditions which rely on timing or other rare occurrences in external systems), harder to troubleshoot.

In my current project the bulk of business tests are integration tests (our system is fully up, but external dependencies are replaced by stubs or fakes, depending on their complexity) accompanied by E2E tests which cover the most common use cases.

/r/programming Thread Parent Link - understandlegacycode.com