Fork me on GitHub
#off-topic
<
2019-10-19
>
jjttjj01:10:17

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.)

jjttjj01:10:05

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

dpsutton01:10:11

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

jumar05:10:49

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

plexus08:10:19

I had fun the past week building this. My first time using Firebase and shadow-cljs. https://hillchart-91fcf.firebaseapp.com/

👍 1