Skip to content

Comment on Scaling Go Testing with Contract and Scenario Mocksparent

Comments

any database worth its salt should be able write and read back the same record

This excludes a lot of cases, like just a simple postgres where reads are done from a replica.

You're free to come up with a better example. The point is that dependencies have behavioral properties that software depends upon. We can write tests for those behaviors. Mocks that are correct and remain so should implement those same behaviors we expect from the prod implementations of those dependencies.

AboutSource Built by g1lg1l

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