4 ms·
Ha! There are maaaany opinions in this thread, but I will add mine. I'm not a fan of writing stupid mocks. That doesn't give me much confidence, and spending
by majke 9y ago
Ha! There are maaaany opinions in this thread, but I will add mine.
I'm not a fan of writing stupid mocks. That doesn't give me much confidence, and spending time on tests is mostly about building ones confidence. I very much prefer running the program end-to-end with defined inputs, and checking its outputs.
Whether that's database, file on disk, or REST api. I write python nosetests that prepare the setup, run golang program, run the checks, and tear down the setup. Sadly, normally it's hard to get golang code coverage for end-to-end tests (aka integration tests). This is what I usually do:
https://blog.cloudflare.com/go-coverage-with-external-tests/ https://blog.cloudflare.com/go-coverage-with-external-tests/