SaaSHub helps you find the best software and product alternatives Learn more โ
Mockery Alternatives
Similar projects and alternatives to mockery
-
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
-
keploy
Open-source platform for creating safe, isolated production sandboxes for API, integration, and E2E testing.
-
-
-
-
-
-
testcontainers-go
Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.
-
-
-
hoverfly
Lightweight service virtualization/ API simulation / API mocking tool for developers and testers
-
-
-
-
kin-openapi
OpenAPI 3.0 and 3.1 (and Swagger v2) implementation for Go (parsing, converting, validation, and more)
-
go-smtp-mock
SMTP mock server written on Golang. Mimic any ๐ค SMTP server behavior for your test environment with fake SMTP server.
-
ecommerce-microservices
Discontinued ๐๏ธ A practical e-commerce Microservices based on Domain Driven Design, Vertical Slice Architecture, CQRS pattern, Event Driven Architecture.
-
Go-MediatR
๐ A library for handling mediator patterns and simplified CQRS patterns within an event-driven architecture, inspired by csharp MediatR library.
-
mockery discussion
mockery reviews and mentions
-
My 2025 review
Mock implementations for testing (using mockery)
-
Professional Testing Experience in Golang
At the organization where I collaborate, the testing stack used testify/mock. During the first three weeks working with this library, I identified that, although it's very popular and has many features, mock setup can be verbose, especially when configuring multiple expectations. While there are tools like mockery (a code generator that creates mocks using testify/mock internally) and recent versions have improved significantly, the usage pattern based on strings and runtime assertions didn't align with my preference for compile-time safety.
-
I Write Tests in Go
I'm far too lazy to write mocks by hand in go. You can generate a mock for a given interface with mockery https://github.com/vektra/mockery
-
go-ecommerce-microservices: A practical e-commerce microservices, built with cqrs, event sourcing, vertical slice architecture, event-driven architecture.
Some of the features: - โ Using Vertical Slice Architecture as a high level architecture - โ Using Event Driven Architecture on top of RabbitMQ Message Broker with a custom [Event Bus](pkg/messaging/bus/) - โ Using Event Sourcing in Audit Based services like [Orders Service](services/orders/) - โ Using CQRS Pattern and Mediator Patternon top of Go-MediatR library - โ Using Dependency Injection and Inversion of Controlon top of uber-go/fx library - โ Using RESTFul api with Echo framework and using swagger with swaggo/swag library - โ Using Postgres and EventStoreDB to write databases with fully supports transactions(ACID) - โ Using MongoDB and Elastic Search for read databases (NOSQL) - โ Using OpenTelemetry for collection Distributed Tracing with using Jaeger and Zipkin - โ Using OpenTelemetry for collection Metrics with using Prometheus and Grafana - โ Using Unit Test for testing small units with mocking dependent classes and using Mockery for mocking dependencies - โ Using End2End Test and Integration Test for testing features with all of their real dependeinces using docker containers (cleanup tests) and testcontainers-go library
- Direction of mockery: absorb different styles of mocks into this project ยท vektra mockery ยท Discussion #671
-
Go: Write Mock Test cases using Mockery and
Read mockery documentation: https://vektra.github.io/mockery/
-
Mocking unexported interfaces?
https://github.com/vektra/mockery is the better mocking framework in my biased opinion. The Google maintainers for gomock seem to have neglected the project.
-
I want to contribute to open source but don't know where to start
There are some one liner changes you can implement in https://github.com/vektra/mockery
-
Is gomock still maintained and recommended?
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.
-
vektra/mockery: v2.21.0 includes "packages" config section, allowing 5x faster mock generation and more fine-grained control over mocks
Please take a look at the documentation linked here, and the related discussion topic that spawned this.
-
A note from our sponsor - SaaSHub
www.saashub.com | 15 Jun 2026
Stats
vektra/mockery is an open source project licensed under BSD 3-clause "New" or "Revised" License which is an OSI approved license.
The primary programming language of mockery is Go.