I still haven't gotten anything right, for example I want to separate tests in a "_test" package because now they live in the same package as the code and it makes me scared :D
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi John,
I didn't unit test the DB layer. I tend not to unless the setup is über complicated. I use a testing db and run the functional tests on it.
I did it with Go using TestMain and a global testing connection (it sucks, I know) but the app is simple enough to make it work.
I have a TestMain per package like this:
More about TestMain and tests: cs-guy.com/blog/2015/01/test-main/ - philosophicalhacker.com/post/integ... - medium.com/@povilasve/go-advanced-... - medium.com/@benbjohnson/structurin...
I still haven't gotten anything right, for example I want to separate tests in a "_test" package because now they live in the same package as the code and it makes me scared :D