Re:I Write Tests in Go
by ashconnor on Thursday April 11, 2024 @11:08PM
(#40009039)
What's the alternative? It's not always easy or practical to reach for "alternative DB implementation" because in most cases that simply doesn't exist.
[ Parent
| on HN ]
Re:I Write Tests in Go
by randomdata on Thursday April 11, 2024 @11:14PM
(#40009082)
Without knowing when mockery is useful, it is impossible to suggest an alternative. There may not be a viable alternative in some cases. That is why I ask. Perhaps you can give us a concrete example to work with, even if contrived? Where have you found mockery to be useful?
The above example, of course, isn't a good one as you can inject an in-memory database (i.e. a hash map) with far less effort than running the mockery tool. But, you are quite right that not all situations are as simple.
What have you got?