Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And better yet, follow the tangential advice and use high fidelity fakes (I usually don't quite go all the way to verified fakes/contract tests, but they're a good idea if you have the time).

Real object where practical, fakes otherwise, mocks only as required for exceptional circumstances.

Works great in interconnected monorepos where you can provide high fidelity fakes of your services for other integrating teams to use in their tests. Often our service fakes are literally just the real service wrapped with an injected fake DB/store.



Fakes are better than mocks if only for the 100x superior debugging experience.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: