Skip to content

Comment on Scaling Go Testing with Contract and Scenario Mocks

Comments

I'm of the opinion that mocks should be provided by the thing that you're mocking. That is, if you are wanting to mock out a service, the mock should be owned by the service that is being mocked.

And then it should be part of that service's test suite, to verify it's own mock.

You update your service? Then you must update the mock.

I guess that's more of a fake, but the naming doesn't matter as much as the behavior.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.