Top 21 Go Mock Projects
GoMock is a mocking framework for the Go programming language. (by golang)Project mention: Mocking with High-Order Functions in Go | reddit.com/r/golang | 2021-08-06
Honestly curious - why wouldn't you use something like https://github.com/golang/mock to generate your mocks from an interface. Way more productive, consistent and cleaner. Spend more time and focus on your business logic rather than something that's already been solved.
Sql mock driver for golang to test database interactionsProject mention: Go Package for better integration tests: github.com/ory/dockertest | dev.to | 2021-04-23
We have different ways to write our tests depending on what datastore we are using, for example if we are testing database calls that happen to be using database/sql then importing a package like github.com/DATA-DOG/go-sqlmock could work.
Run Linux Software Faster and Safer than Linux with Unikernels.
A mock code autogenerator for Golang (by vektra)Project mention: mockcompose to generate mocking implementation for Go classes, interfaces and functions | reddit.com/r/golang | 2021-07-06
As a Go newbie, the on-boarding process to Golang went relatively smoothly except a small glitch when it came to search for a mocking framework to test out a Go class implementation. I was a bit surprised to realize that I was not able to find a on-shelf tool to help me mock a class method. It might be an edge case scenario that I wanted to mock a class method, but I do believe that this is a valid use case, so I went ahead to spend a weekend building such a tool: mockcompose. It was originally aimed to just solve this one particular use case, therefore, it had to be used together with mockery (one of the great tools I found during my search in the period). I later refined the tool to cover mocking code generation for Go interfaces and functions, mockcompose can now be used in most of Go unit test scenarios. Please check it out and give it a try, I hope the tool is useful, feel free to drop your feedback and share with your opinion there.
Lightweight service virtualization/API simulation tool for developers and testers
HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽Project mention: Go Package for Mocking HTTP Traffic: github.com/h2non/gock | dev.to | 2021-04-16
Last time I covered testing in Go I mentioned a package used for testing equality called github.com/google/go-cmp, this time I will share with you a way to mock HTTP traffic using the package github.com/h2non/gock.
HTTP mocking for GolangProject mention: Best practices around mocking interfaces from external packages | reddit.com/r/golang | 2021-05-06
Alternatively, you could use an http mock library like https://github.com/jarcoal/httpmock, and override the urls the RealClient calls with a mock response in your tests.
A tool for generating self-contained, type-safe test doubles in goProject mention: Slack notification Github action | reddit.com/r/golang | 2021-08-06
Scout APM: A developer's best friend. Try free for 14-days. Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
Mmock is an HTTP mocking application for testing and fast prototyping
Powerful mock generation tool for Go programming language
Immutable transaction isolated sql driver for golang
Simple way to generate mock servers written in GoProject mention: How to integrate an external API into your PHP application🔥 | dev.to | 2021-08-10
I have used Killgrave and the result was really good. The best of all is that you can configure a mock API just using yml configurations files.
HTTP mock for Golang: record and replay HTTP/HTTPS interactions for offline testing
A test-friendly replacement for golang's time package (by cabify)
Mr. gomockhandler is the clever and fast manager of golang/mock.Project mention: more clever and faster management for gomock (sanposhiho/gomockhandler) | reddit.com/r/golang | 2021-08-19
Mock object for Go http.ResponseWriter
Go Wrapper for using localstack
Golang HTTP client testing framework
A language agnostic HTTP mock server for quick stub testing
Library that make mocking of Go functions/methods easy (by pasdam)Project mention: Unit Testing in Golang | reddit.com/r/golang | 2021-02-01
mockcompose generates mocking implementation for Go classes, interfaces and functionsProject mention: mockcompose to generate mocking implementation for Go classes, interfaces and functions | reddit.com/r/golang | 2021-07-06
Part of reason that I went ahead to build mockcompose was for to improve test coverage of an existing project without major refactoring. Another reason is for completeness of a mocking tool to cover all possible aspects in unit-test scenarios that Go technically allows. It was meant to use it with Go best practices in mind.
Webmock for Golang, to stub requests. (by hlcfan)
What are some of the best open-source Mock projects in Go? This list will help you:
Are you hiring? Post a new remote job listing for free.