DEV Community

Discussion on: Service calls make your tests better

Collapse
lewiscowles1986 profile image
Lewis Cowles • Edited on

Think about it this way instead. You can have both a unit test fully mocked and real live tests that run a few times per-day. There is absolutely no reason to use one or the other; but where you choose to use them could really hurt.

There is no reason to run your integration tests every time you run a unit-test. Just put a timer as well as commit trigger in your CI, make the implementing part a library and unit test in your application. You'll control the API you use; you'll be able to unit-test and if for some reason the service changes, you'll have a single point to update.