by badrequest on 4/10/24, 3:49 PM with 27 comments
by kbolino on 4/11/24, 1:02 PM
Also, the shadowing of t in t.Run is intentional. You should not try to work around it. There's no risk of confusion either because you will always use the right one in the right place.
by ashconnor on 4/11/24, 4:33 AM
by coffeebeqn on 4/11/24, 1:38 AM
by tommiegannert on 4/11/24, 7:10 AM
I'd add using testing.T.Cleanup for tearing down the testcontainer (or use a TestMain and a deferred if the container is slow and concurrency-safe.)
by count_chocula on 4/12/24, 10:36 PM
by jozvolskyef on 4/10/24, 8:36 PM
- I prefer state-based TDD as opposed to interaction-based (see https://martinfowler.com/articles/mocksArentStubs.html).
- I've used both testcontainers and dockertest, and from my experience dockertest is more robust.
- The capital T for the outer argument comes across as being hypercorrect. Why would one consider the shadowing of this argument bad?