3 ms·
You'd be surprised. Often that dude will have preferences that go way beyond linters and may even contradict widely accepted best practices. I've worked with
by refenestrator 5y ago
You'd be surprised. Often that dude will have preferences that go way beyond linters and may even contradict widely accepted best practices.
I've worked with the dude who insisted on factoring out functions for unrelated 2-liners, creating extra coupling where we don't want it, the dude who insisted on mocking library code in tests when it would be easier and more thorough to just use it and make sure we're calling it right..
My favorite was the dude who, after 3 days of back and forth changes on a semi-urgent PR goes silent for a day, I ping him, he says "thinking of more comments :)" with the goddamned smiley.
- icedchai 5y agoYes, or the guy who wants you to mock out database calls because it's not a "real unit test" otherwise. So you spend another day mocking out crap when it's both easier and less error-prone to use the real thing. I guess the time spent will pay for itself... in 10 years.
- ryan_lane 5y agoThe point here is to be able to run the tests without a database, and in this case they're probably right. Saying it's for the sake of purity of the test type is wrong, but you should mock out database calls in unit tests because you want them to run fast and without dependencies. Move those tests to integration...
- icedchai 5y agoWe don’t run tests without a database. Never been anywhere that did. I greatly prefer integration tests, in general. They almost always have value.
- mixmastamyk 5y agoHah! The simple answer to that however, is "No." With a link to standards/best-practices if you want to be polite. Unless dude is your boss, in which the answer is "Yes," and the paycheck arrives on Friday. Also, sometimes other people are right... something to remind myself of. ;-)