2 ms·
I’ve spent most of my career as a developer with a specialty in testing, and my gut always says mock as little as possible. Basically never mock local code tha
by petesergeant 4y ago
I’ve spent most of my career as a developer with a specialty in testing, and my gut always says mock as little as possible.
Basically never mock local code that runs in-process, unless it’s to capture side-effects (eg loggers, and in that case dep inject), use a real database (in-memory or test-specific), and only mock stuff that’s a real, has-latency 3rd party service — but if possible, dependency inject it instead