Fork me on GitHub

On the subject of testing, if I'm testing something that connects to an external service, like a rest client wrapper, I assume the unit tests generally wouldn't make http requests but rather mock the expected results, and/or test the other parts of the system around the actual requests. But I'm wondering, is there a term for a level of testing which WOULD actually make the real http requests? Sort of like an actual demo app but built around assertions? And if this is a real thing, would it still use a bunch of deftests like normal unit tests? (Assume there are no sandbox endpoints but in practice it's fine/inexpensive to use the real one.)


Or is it actually just fine to do real http requests, connect to real databases, etc in unit tests?


It really just changes the name of the test from unit test to integration test. And you should probably keep them separate different namespaces for sure. Possibly different profiles to just run one or the other if you want. The principal downside comes when they fail outside of your control: rate limiting, weird testing infra, etc


I've found that mocking usually doesn't make much sense here. Lot of effort, dubious results


I had fun the past week building this. My first time using Firebase and shadow-cljs.

👍 4