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

Go Testing Assertions and Mocking

Ranking updated Jun 30, 2026

For a testing assertions and mocking library for Go, the first results are stretchr/testify (stretchr/testify is the de facto standard Go testing library, offering both assertion functions and a mocking framework that integrate seamlessly with go test, which directly matches the need for a simple yet powerful testing toolkit), golang/mock (GoMock is a powerful mocking framework for Go, but it lacks assertion functions, so it only partially meets the need for a combined assertion and mocking library; you would need to pair it with a separate assertion package) and cweill/gotests (gotests generates test scaffolding and boilerplate from source code, but it does not provide assertion functions or mocking capabilities; it's a test generation tool rather than a library for writing tests with assertions and mocks). smartystreets/goconvey and onsi/ginkgo round out the shortlist. Compare the match explanations and check the project documentation against your requirements.

Collection of libraries for writing unit tests, managing test assertions, and creating mock objects in Go.

Go Testing Assertions and Mocking

Find the best repos with AI.We'll search the best matching repositories with AI.
  • stretchr/testifystretchr avatar

    stretchr/testify

    25,861View on GitHub↗

    Testify is a comprehensive testing toolkit for Go that provides a suite of assertion libraries and mocking frameworks to validate code behavior. It enables developers to write automated tests by comparing actual results against expected outcomes, ensuring that functional requirements are met throughout the development process. The project distinguishes itself through its flexible failure propagation, which allows tests to either halt execution immediately upon a failed requirement or return boolean results for conditional logic. It includes deep-equality object comparison and JSON normalizati

    stretchr/testify is the de facto standard Go testing library, offering both assertion functions and a mocking framework that integrate seamlessly with go test, which directly matches the need for a simple yet powerful testing toolkit.

    GoMocking Frameworks
    View on GitHub↗25,861
  • golang/mockgolang avatar

    golang/mock

    9,361View on GitHub↗

    GoMock is a mocking framework for the Go programming language.

    GoMock is a powerful mocking framework for Go, but it lacks assertion functions, so it only partially meets the need for a combined assertion and mocking library; you would need to pair it with a separate assertion package.

    GoMocking FrameworksTest Double Libraries
    View on GitHub↗9,361
  • 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

    gotests generates test scaffolding and boilerplate from source code, but it does not provide assertion functions or mocking capabilities; it's a test generation tool rather than a library for writing tests with assertions and mocks.

    GoGo Testing FrameworksTable-Driven Tests
    View on GitHub↗5,315
  • smartystreets/goconveysmartystreets avatar

    smartystreets/goconvey

    8,415View on GitHub↗

    GoConvey is a behavioral testing framework for the Go programming language that provides a test runner, a code coverage tool, and a web-based monitoring dashboard. It integrates with the standard Go test command to organize tests into behavioral stories and conveyors. The project features a web interface that monitors the file system for source code changes and automatically triggers test execution to provide real-time feedback. This dashboard displays test results, failures, and a chronological history of execution status. The framework includes a state assertion system for verifying values

    GoConvey is a behavioral test framework with a web dashboard and state assertions, but it lacks mocking capabilities and is not a focused assertion-and-mocking library for simplifying test writing.

    GoGo Testing Frameworks
    View on GitHub↗8,415
  • onsi/ginkgoonsi avatar

    onsi/ginkgo

    9,014View on GitHub↗

    Ginkgo is a behavior-driven development testing framework, assertion library, and test runner for Go. It provides a domain-specific language for writing human-readable specifications, organizing tests into hierarchical containers and subjects to describe system behavior. The project distinguishes itself through advanced execution control and observability, featuring a test runner capable of parallel distribution, sharding, and randomized execution order to detect flaky tests. It includes specialized diagnostic tools for goroutine leak detection, hanging spec monitoring, and failure state debu

    Ginkgo is a full BDD testing framework with assertion capabilities and some mock support (HTTP mock servers), but it is more comprehensive than the focused assertion-and-mocking library you're looking for, and its DSL is not minimal.

    GoGo Testing FrameworksAssertion LibrariesAssertion Matchers
    View on GitHub↗9,014
  • gruntwork-io/terratestgruntwork-io avatar

    gruntwork-io/terratest

    7,879View on GitHub↗

    Terratest is a Go library and testing framework designed for automating the deployment, validation, and destruction of infrastructure stacks. It serves as a cloud resource verification tool that interacts with provider APIs and executes remote shell commands to ensure infrastructure definitions are correctly configured. The framework provides specialized support for validating Terraform modules and Kubernetes deployments, including the verification of container orchestration manifests and Helm charts. It distinguishes itself through the use of Docker container utilities for script execution a

    Terratest is a Go library for testing infrastructure (Terraform, Kubernetes, Docker) rather than a general-purpose assertion and mocking library for Go code, so it does not directly match your search for simplifying standard Go unit tests.

    GoGo Testing Frameworks
    View on GitHub↗7,879
  • keploy/keploykeploy avatar

    keploy/keploy

    17,622View on GitHub↗

    Keploy is an automated testing platform that leverages kernel-level traffic interception to generate and maintain regression test suites for microservices. By capturing live network traffic and system calls via eBPF, the platform automatically creates deterministic test cases and mocks external dependencies without requiring manual code instrumentation. This approach allows developers to validate application behavior and API contracts by replaying production-like traffic in isolated environments. The platform distinguishes itself through its use of machine learning to perform test maintenance

    Keploy is an automated testing platform that generates test cases from network traffic, not a Go library you import for assertion functions and mocking in your own tests — it automates testing rather than providing test-writing primitives.

    GoDependency Mocking
    View on GitHub↗17,622
Compare the top 10 at a glance
RepositoryStarsLanguageLicenseLast push
stretchr/testify25.9KGomitFeb 17, 2026
golang/mock9.4KGoApache-2.0Jan 8, 2024
cweill/gotests
5.3K
Go
Apache-2.0
Oct 30, 2025
smartystreets/goconvey8.4KGoNOASSERTIONJul 30, 2024
onsi/ginkgo9KGoMITJun 14, 2026
gruntwork-io/terratest7.9KGoapache-2.0Feb 21, 2026
keploy/keploy17.6KGoApache-2.0Jun 16, 2026

Related searches

  • a testing framework for Go applications
  • a mocking library for stubbing HTTP requests in tests
  • a testing framework for Swift applications
  • a unit testing framework for C++
  • a unit testing framework for C#
  • a unit testing framework for JavaScript with snapshots
  • a testing framework for Python with fixtures
  • a data validation library for Go