awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
vektra avatar

vektra/mockery

0
View on GitHub↗
7,141 stars·454 forks·Go·BSD-3-Clause·20 viewsvektra.github.io/mockery↗

Mockery

Mockery is a code generation tool that produces mock implementations from Go interfaces, designed to simplify unit testing by automating the creation of test doubles. It parses Go source files using abstract syntax tree analysis to extract interface method signatures, then generates complete mock struct types that implement those interfaces with configurable function fields for test injection.

The tool distinguishes itself through its configuration and customization capabilities. Rather than embedding directives in source code annotations, Mockery reads generation settings from a YAML configuration file, centralizing mock generation parameters. It also supports custom Go text/templates to control the structure and behavior of generated mock code, allowing teams to shape output to match their testing patterns and conventions.

Mockery covers the full workflow of interface-to-mock generation, from parsing interface definitions to producing ready-to-use mock source files. Its template-driven output and YAML-based configuration provide a flexible foundation for integrating mock generation into existing Go testing workflows.

Features

  • Go Interface - A framework that creates mock objects from Go interface definitions to simplify test setup and verification.
  • Method Signature Analyzers - Analyzes parameter and return types of interface methods to generate matching mock function signatures.
  • Mock Code Generators - Automatically generates mock implementations from Go interfaces for use in unit testing and dependency injection.
  • Interface Mock Generators - Generates mock implementations from Go interfaces to replace real dependencies in unit tests.
  • Interface AST Parsers - Parses Go interface definitions into ASTs to extract method signatures for mock generation.
  • Compile-Time Code Generation - Generates mock source files at build time by parsing Go interfaces and producing implementation code.
  • Test Service Injections - Creates mock objects that can be injected into Go code to isolate and test specific components.
  • Struct-Based - Creates struct types that implement interfaces by delegating to configurable function fields for test injection.
  • Interface-to-Mock Generators - Generates mock objects from Go interfaces to remove manual boilerplate needed for testing with mock frameworks.
  • Code Generation Templates - Uses Go text/template files to control the structure and behavior of generated mock code.
  • Template-Based Code Customizers - Uses custom templates and template data to control the structure and behavior of generated mocks.
  • Mock Generation Template Customizers - Supplies custom templates and data to shape the structure and behavior of generated mock code.
  • YAML Configuration Files - Reads mock generation settings from a YAML file to centralize configuration instead of using source code annotations.
  • Mock Generation Configuration Files - Configures mock generation settings in a YAML file instead of scattering directives across source code.
  • Mock Generator Configurations - Reads configuration from YAML files instead of inline source code directives for mock generation.
  • Generation Templates - Customizes generated mock code by supplying templates and template data to control its structure and behavior.
  • Mock Generation Configurations - Configures mock generation settings and templates through a YAML file instead of inline source annotations.
  • Frameworks and Libraries - An automatic mock code generator for testing.
  • Testing Frameworks - Generates mock code for interfaces.

Star history

Star history chart for vektra/mockeryStar history chart for vektra/mockery

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Mockery

Similar open-source projects, ranked by how many features they share with Mockery.
  • uber-go/mockuber-go avatar

    uber-go/mock

    3,375View on GitHub↗

    This project is a framework for generating mock implementations of interfaces to isolate dependencies and verify method interactions during unit testing in Go. It provides tools to simulate external dependencies by creating controlled mock objects, allowing developers to test components in isolation without requiring real service connections. The library distinguishes itself through its use of static interface reflection to generate type-safe mock structures during the build process. It features a fluent assertion API that enables developers to define expected method calls, validate arguments

    Go
    View on GitHub↗3,375
  • ent/entent avatar

    ent/ent

    17,110View on GitHub↗

    Ent is a statically typed entity framework for Go that models database structures as a graph of nodes and edges. It functions as a code generation engine that transforms schema definitions into type-safe database clients, query builders, and migration scripts. By representing data as interconnected entities, the framework enables intuitive traversal of complex relationships and ensures that database interactions remain consistent with the application model at compile time. The framework distinguishes itself through its graph-based approach to data modeling and its reliance on compile-time cod

    Goententity-frameworkorm
    View on GitHub↗17,110
  • quarkusio/quarkusquarkusio avatar

    quarkusio/quarkus

    15,479View on GitHub↗

    Quarkus is a Kubernetes-native Java framework designed for building high-performance, memory-efficient applications. It utilizes ahead-of-time native compilation to transform Java code into standalone, optimized binaries that eliminate the need for a virtual machine, enabling rapid startup and reduced memory consumption. By performing code augmentation during the build phase, it shifts heavy processing tasks away from runtime, ensuring that applications are optimized for cloud-native environments. The framework distinguishes itself through a unified approach to reactive and imperative program

    Javacloud-nativehacktoberfestjava
    View on GitHub↗15,479
  • cweill/gotestscweill avatar

    cweill/gotests

    5,315View on GitHub↗

    gotests is a static analysis tool and boilerplate generator for Go that automatically creates structured test suites from source code. It functions as a table-driven test framework that handles type resolution for functions and methods, including the mapping of generic type constraints to concrete implementation types. The tool integrates with large language models to synthesize realistic input values and edge cases based on function logic. It uses a template-driven generation system, allowing the structure and format of the resulting test code to be customized through external templates and

    Gocode-generatorcommandlinego
    View on GitHub↗5,315
See all 30 alternatives to Mockery→

Frequently asked questions

What does vektra/mockery do?

Mockery is a code generation tool that produces mock implementations from Go interfaces, designed to simplify unit testing by automating the creation of test doubles. It parses Go source files using abstract syntax tree analysis to extract interface method signatures, then generates complete mock struct types that implement those interfaces with configurable function fields for test injection.

What are the main features of vektra/mockery?

The main features of vektra/mockery are: Go Interface, Method Signature Analyzers, Mock Code Generators, Interface Mock Generators, Interface AST Parsers, Compile-Time Code Generation, Test Service Injections, Struct-Based.

What are some open-source alternatives to vektra/mockery?

Open-source alternatives to vektra/mockery include: uber-go/mock — This project is a framework for generating mock implementations of interfaces to isolate dependencies and verify… ent/ent — Ent is a statically typed entity framework for Go that models database structures as a graph of nodes and edges. It… quarkusio/quarkus — Quarkus is a Kubernetes-native Java framework designed for building high-performance, memory-efficient applications.… cweill/gotests — gotests is a static analysis tool and boilerplate generator for Go that automatically creates structured test suites… go-swagger/go-swagger — go-swagger is a toolkit for working with Swagger/OpenAPI 2.0 specifications in Go. It generates server, client, and… astahmer/openapi-zod-client — This project is a command-line tool that automates the creation of type-safe TypeScript HTTP clients directly from…