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
uber-go avatar

uber-go/mock

0
View on GitHub↗
3,375 stars·167 forks·Go·Apache-2.0·17 views

Mock

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 using matchers, and enforce specific call sequences. Furthermore, it supports dynamic behavior injection, allowing for the definition of custom logic via anonymous functions to simulate complex side effects.

The framework covers a broad range of testing capabilities, including automated assertion of function interactions and the configuration of stubbed behavior. It also provides mechanisms for customizing error reporting to clarify discrepancies between expected and actual method calls during test failures. The project is distributed as a command-line tool and library for integration into automated test suites.

Features

  • Go Interface - Provides a framework for generating mock implementations of interfaces to isolate dependencies and verify method calls.
  • Interface Mock Generators - Generates mock implementations from Go interfaces to simulate dependencies without requiring real service connections.
  • Mock Call Count Verification - Asserts that specific methods receive expected arguments and return predefined values during test execution.
  • Dependency-Mocked Unit Testers - Isolates code components by replacing external dependencies with controlled mock objects for reliable unit testing.
  • Go Testing Frameworks - Offers a comprehensive toolset for simulating dependencies and asserting behavior within Go test suites.
  • Compile-Time Mock Generation - Generates mock implementations during the build process to ensure type safety and avoid runtime reflection.
  • Interface-to-Mock Generators - Analyzes interface definitions to automatically generate mock structures for dependency isolation.
  • Automated Test Execution - Verifies that functions receive expected arguments and return correct values during automated test execution.
  • Dynamic Behavior Injection - Allows overriding mock method logic at runtime using anonymous functions to simulate complex side effects.
  • Argument Matchers - Validates method arguments against predefined criteria to ensure interactions meet test expectations.
  • Mock Behavior Configuration - Defines custom logic for mock methods using anonymous functions to simulate complex side effects.
  • Fluent Assertions - Provides a chainable, readable API for defining expected method calls and return values in tests.
  • Interaction Sequence Orderers - Enforces strict ordering and frequency requirements for method calls on mock objects during test execution.

Star history

Star history chart for uber-go/mockStar history chart for uber-go/mock

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 Mock

Similar open-source projects, ranked by how many features they share with Mock.
  • rspec/rspec-mocksrspec avatar

    rspec/rspec-mocks

    1,148View on GitHub↗

    This project is a Ruby unit testing tool designed for dependency isolation and behavioral contract verification. It functions as a comprehensive mocking framework that allows developers to replace real objects with controlled placeholders, ensuring that code interacts with its dependencies as expected during automated test execution. The framework distinguishes itself through its ability to perform partial double verification, which checks that stubbed methods exist on the underlying object to prevent tests from passing against incorrect interfaces. It also provides sophisticated constant man

    Rubyrspecruby
    View on GitHub↗1,148
  • thomhurst/tunitthomhurst avatar

    thomhurst/TUnit

    3,744View on GitHub↗

    TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source generation for test discovery and mock creation, ensuring compatibility with Native AOT and IL trimming by eliminating the need for runtime reflection and proxies. The framework provides specialized capabilities for integration testing, including the management of distributed application lifecycles, isolated database schemas, and the correlation of telemetry and logs across process boundaries via OTLP. It also includes an HTTP testing utility to intercept network exchanges and mock AP

    C#csharpdotnettest
    View on GitHub↗3,744
  • vektra/mockeryvektra avatar

    vektra/mockery

    7,141View on GitHub↗

    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 configu

    Gogenerationgeneratorgo
    View on GitHub↗7,141
  • amitshekhariitbhu/go-backend-clean-architectureamitshekhariitbhu avatar

    amitshekhariitbhu/go-backend-clean-architecture

    6,059View on GitHub↗

    This is a Go backend template that structures a web service into domain, usecase, controller, and repository layers with strict dependency inversion. It provides a foundation for building maintainable and testable REST APIs by separating business logic from transport and data access concerns. The project implements JWT-based authentication, issuing access and refresh tokens for user signup, login, and protected endpoint access. It uses the Gin HTTP framework to build a Docker-packaged REST API with public and private route groups, request validation, and middleware-based authentication. Depen

    Goapiarchitecturebackend
    View on GitHub↗6,059
See all 30 alternatives to Mock→

Frequently asked questions

What does uber-go/mock do?

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.

What are the main features of uber-go/mock?

The main features of uber-go/mock are: Go Interface, Interface Mock Generators, Mock Call Count Verification, Dependency-Mocked Unit Testers, Go Testing Frameworks, Compile-Time Mock Generation, Interface-to-Mock Generators, Automated Test Execution.

What are some open-source alternatives to uber-go/mock?

Open-source alternatives to uber-go/mock include: rspec/rspec-mocks — This project is a Ruby unit testing tool designed for dependency isolation and behavioral contract verification. It… thomhurst/tunit — TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source… vektra/mockery — Mockery is a code generation tool that produces mock implementations from Go interfaces, designed to simplify unit… amitshekhariitbhu/go-backend-clean-architecture — This is a Go backend template that structures a web service into domain, usecase, controller, and repository layers… geektutu/high-performance-go — This project is a comprehensive performance programming guide and reference for the Go language, focusing on runtime… smartystreets/goconvey — GoConvey is a behavioral testing framework for the Go programming language that provides a test runner, a code…

Curated searches featuring Mock

Hand-picked collections where Mock appears.
  • Go Testing Assertions and Mocking
  • Test isolation tools