SaaSHub helps you find the best software and product alternatives Learn more →
Top 16 Go Mocking Projects
-
To answer OP directly, I am largely quite happy with mockery (and testify) to write expressive tests.
-
When there's just one heavyweight dependency you're interacting with, perhaps a one-off stub/fake is simpler, but I would posit that auto-generated mocks via things like mockery + go:generate leave less test code to maintain vs. perhaps many stubs across the project.
-
SonarQube
Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
-
hoverfly
Lightweight service virtualization/ API simulation / API mocking tool for developers and testers
Project mention: We created WireMock, an API platform that is designed to improve developer productivity and enables developers and testers to Mock APIs in every stage of the API lifecycle | reddit.com/r/golang | 2023-02-02Use https://github.com/SpectoLabs/hoverfly
-
Mocking the http client with explicit responses; for example using h2non/gock
-
``` https://github.com/matryer/moq
-
apitest
A simple and extensible behavioural testing library for Go. You can use api test to simplify REST API, HTTP handler and e2e tests.
Project mention: Writing unit tests for an a library that needs to perform internet related tasks? | reddit.com/r/golang | 2023-03-21take a look at something like: github.com/steinfletcher/apitest mock the behaviour, record calls and assert.
-
-
InfluxDB
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
-
-
-
The same idea was used to generate and mock sql queries in keploy - https://github.com/keploy/go-sdk/tree/main/integrations/ksql
-
-
-
-
-
-
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Go Mocking related posts
- Is gomock still maintained and recommended?
- vektra/mockery: v2.21.0 includes "packages" config section, allowing 5x faster mock generation and more fine-grained control over mocks
- Issue implementing interface method that returns another interface
- FEEDBACK REQUESTED: Deprecation of automatic interface discovery · Discussion #549 · vektra/mockery
- Testing calls to external APIs
- Mock HTTP response
- How do you write/generate mocks for testing?
-
A note from our sponsor - #<SponsorshipServiceOld:0x00007f160f9b9818>
www.saashub.com | 24 Mar 2023
Index
What are some of the best open-source Mocking projects in Go? This list will help you:
Project | Stars | |
---|---|---|
1 | Testify | 19,223 |
2 | mockery | 4,470 |
3 | hoverfly | 2,039 |
4 | gock | 1,816 |
5 | moq | 1,523 |
6 | apitest | 614 |
7 | vfs for golang | 442 |
8 | dummy | 170 |
9 | go-github-mock | 62 |
10 | go-sdk | 33 |
11 | mockc | 30 |
12 | mocha | 27 |
13 | mockcompose | 14 |
14 | mockit | 14 |
15 | mockitout | 10 |
16 | gokka | 3 |