8
Awlex
354d

I thought I had seen everything, but today a coworker tried to call one test case from another and asked me if that is an okay thing to do.

Comments
  • 1
    was he trying a chained-test scenario?
  • 5
    @azuredivay No, a "no idea what I'm doing, but that code looks like it could work"-case
  • 3
    @ostream no, tests are for those that know how to write good tests ;)

    In a bigger project it helps prevent regressions in code and personally I use them in a TDD role when designing more complex logic like lexer/parsers or complex validation logic.
  • 1
    @ostream I hope you're sarcastic or don't have to manage anything
  • 0
    @jestdotty The answer is to use the previous test as a reference, understand what it does and add a single assert statement, instead of doing this
  • 0
    @jestdotty No, the part where you understand what you're doing is more important to me. I'm busy myself and don't want to review code that doesn't make sense every time I'm being asked for advice or a merge request becomes "ready"
Add Comment