Awesome Go

Testing

100+ libraries in this category

Testify

Sacred extension to the standard go testing package

26,230TestingTesting Frameworks
keploy

Generate Testcase and Data Mocks from API calls automatically

18,575TestingTesting Frameworks
chromedp

a way to drive/test Chrome, Safari, Edge, Android Webviews, and other browsers supporting the Chrome Debugging Protocol

13,312TestingSelenium and browser control tools
GoConvey

BDD-style framework with web UI and live reload

8,399TestingTesting Frameworks
mockery

Tool to generate Go interfaces

7,171TestingMock
rod

A Devtools driver to make web automation and scraping easy

7,131TestingSelenium and browser control tools
go-sqlmock

Mock SQL driver for testing database interactions

6,572TestingMock
testcontainers-go

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

5,009TestingTesting Frameworks
go-fuzz

Randomized testing system

4,848TestingFuzzing and delta-debugging/reducing/shrinking
go-cmp

Package for comparing Go values in tests

4,678TestingTesting Frameworks
playwright-go

browser automation library to control Chromium, Firefox and WebKit with a single API

3,520TestingSelenium and browser control tools
gomock

Mocking framework for the Go programming language

3,423TestingMock
httpexpect

Concise, declarative, and easy to use end-to-end HTTP and REST API testing

2,724TestingTesting Frameworks
godog

Cucumber BDD framework for Go

2,682TestingTesting Frameworks
hoverfly

HTTP(S) proxy for recording and simulating REST/SOAP APIs with extensible middleware and easy-to-use CLI

2,525TestingMock
moq

Utility that generates a struct from any interface. The struct can be used in test code as a mock of the interface

2,205TestingMock
httpmock

Easy mocking of HTTP responses from external resources

2,079TestingMock
is

Professional lightweight testing mini-framework for Go

1,974TestingTesting Frameworks
gnomock

integration testing with real dependencies (database, cache, even Kubernetes or AWS) running in Docker, without mocks

1,487TestingTesting Frameworks
go-vcr

Record and replay your HTTP interactions for fast, deterministic and accurate tests

1,397TestingTesting Frameworks
tparse

CLI tool for summarizing go test output. Pipe friendly. Compatible with go test flags

1,260TestingTesting Frameworks
embedded-postgres

Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test

1,248TestingTesting Frameworks
testfixtures

A helper for Rails' like test fixtures to test database applications

1,238TestingTesting Frameworks
counterfeiter

Tool for generating self-contained mock objects

1,143TestingMock
failpoint

An implementation of [failpoints](https://www.freebsd.org/cgi/man.cgi?query=fail) for Golang

896TestingFail injection
go-httpbin

HTTP testing and debugging tool with various endpoints for client testing

885TestingTesting Frameworks
goblin

Mocha like testing framework of Go

885TestingTesting Frameworks
goc

Goc is a comprehensive coverage testing system for The Go Programming Language

873TestingTesting Frameworks
cdp

Type-safe bindings for the Chrome Debugging Protocol that can be used with browsers or other debug targets that implement it

795TestingSelenium and browser control tools
baloo

Expressive and versatile end-to-end HTTP API testing made easy

779TestingTesting Frameworks
minimock

Mock generator for Go interfaces

751TestingMock
go-txdb

Single transaction based database driver mainly for testing purposes

749TestingMock
pgxmock

A mock library implementing [pgx - PostgreSQL Driver and Toolkit](https://github.com/jackc/pgx/)

598TestingMock
gotest.tools

A collection of packages to augment the go testing package and support common patterns

577TestingTesting Frameworks
go-testdeep

Extremely flexible golang deep comparison, extends the go testing package

462TestingTesting Frameworks
gofight

API Handler Testing for Golang Router framework

445TestingTesting Frameworks
xgo

A general pureposed function mocking library

431TestingMock
testza

Full-featured test framework with nice colorized output

415TestingTesting Frameworks
cupaloy

Simple snapshot testing addon for your test framework

333TestingTesting Frameworks
arch-go

Architecture testing tool for Go projects

276TestingTesting Frameworks
frisby

REST API testing framework

274TestingTesting Frameworks
go-snaps

Jest-like snapshot testing in Golang

270TestingTesting Frameworks
endly

Declarative end to end functional testing

269TestingTesting Frameworks
got

An enjoyable golang test framework

266TestingTesting Frameworks
go-hit

Hit is an http integration test framework written in golang

255TestingTesting Frameworks
go-carpet

Tool for viewing test coverage in terminal

251TestingTesting Frameworks
Tavor

Generic fuzzing and delta-debugging framework

248TestingFuzzing and delta-debugging/reducing/shrinking
go-test-coverage

Tool that reports coverage of files below set threshold

240TestingTesting Frameworks
commander

Tool for testing cli applications on windows, linux and osx

232TestingTesting Frameworks
charlatan

Tool to generate fake interface implementations for tests

205TestingTesting Frameworks
govcr

HTTP mock for Golang: record and replay HTTP interactions for offline testing

200TestingMock
Testo

Plugin-based testing framework with suites, parallel tests, hooks and parametrization. Inspired by Pytest

167TestingTesting Frameworks
dbcleaner

Clean database for testing purpose, inspired by `database_cleaner` in Ruby

163TestingTesting Frameworks
jsonassert

Package for verifying that your JSON payloads are serialized correctly

144TestingTesting Frameworks
be

The minimalist generic test assertion library

133TestingTesting Frameworks
testcase

Idiomatic testing framework for Behavior Driven Development

133TestingTesting Frameworks
gocrest

Composable hamcrest-like matchers for Go assertions

108TestingTesting Frameworks
wstest

Websocket client for unit-testing a websocket http.Handler

102TestingTesting Frameworks
gherkingen

BDD boilerplate generator and framework

99TestingTesting Frameworks
selenosis

Stateless Kubernetes-native hub that routes Selenium, Playwright, and MCP sessions to on-demand browser pods via custom resources

94TestingSelenium and browser control tools
go-localstack

Tool for using localstack in AWS testing

88TestingMock
testcerts

Dynamically generate self-signed certificates and certificate authorities within your test functions

84TestingTesting Frameworks
timex

A test-friendly replacement for the native `time` package

71TestingMock
assert

Basic Assertion Library used along side native go testing, with building blocks for custom assertions

67TestingTesting Frameworks
restit

Go micro framework to help writing RESTful API integration test

54TestingTesting Frameworks
gospecify

This provides a BDD syntax for testing your Go code. It should be familiar to anybody who has used libraries such as rspec

52TestingTesting Frameworks
should

Testing library with zero dependencies, detailed struct diffs and human-readable error messages

48TestingTesting Frameworks
dsunit

Datastore testing for SQL, NoSQL, structured files

47TestingTesting Frameworks
gomatch

library created for testing JSON against patterns

47TestingTesting Frameworks
fixenv

Fixture manage engine, inspired by pytest fixtures

35TestingTesting Frameworks
axiom

Composable Go test framework with fixtures, hooks, retries, metadata, plugins, and parallel execution

33TestingTesting Frameworks
Hamcrest

fluent framework for declarative Matcher objects that, when applied to input values, produce self-describing results

30TestingTesting Frameworks
fabricator

Type-safe factories for generating mock and fake data in Go, inspired by factory_boy and interface-forge

30TestingMock
flute

HTTP client testing framework

23TestingTesting Frameworks
mockhttp

Mock object for Go http.ResponseWriter

23TestingMock
schema

Quick and easy expression matching for JSON schemas used in requests and responses

20TestingTesting Frameworks
dft

Lightweight, zero dependency docker containers for testing (or more)

19TestingTesting Frameworks
mooncake

A simple way to generate mocks for multiple purposes

18TestingMock
gogiven

YATSPEC-like BDD testing framework for Go

17TestingTesting Frameworks
testsql

Generate test data from SQL files before testing and clear it after finished

17TestingTesting Frameworks
bonk

Fast, stealth-first browser automation library using Chrome DevTools Protocol over WebSocket with no external dependencies

15TestingSelenium and browser control tools
biff

Bifurcation testing framework, BDD compatible

14TestingTesting Frameworks
stop-and-go

Testing helper for concurrency

13TestingTesting Frameworks
gosuite

Brings lightweight test suites with setup/teardown facilities to `testing` by leveraging Go1.7's Subtests

12TestingTesting Frameworks
Tt

Simple and colorful test tools

10TestingTesting Frameworks
mockfs

Mock filesystem for Go testing with error injection and latency simulation, built on `testing/fstest.MapFS`

9TestingMock
go-testpredicate

Test predicate style assertions library with extensive diagnostics output

7TestingTesting Frameworks
gomock

CLI tool to generate typed and framework-agnostic interface mocks, with support for generics

7TestingMock
trial

Quick and easy extendable assertions without introducing much boilerplate

6TestingTesting Frameworks
go-mutesting

Mutation testing for Go with CI quality gates, coverage-aware MSI, baseline tracking, and git-diff filtering

6TestingTesting Frameworks
go-testing

Go testing extension, that allows a simple setup of strongly isolated unit, component, and integration test providing advanced mock support extending gomock and gock

6TestingTesting Frameworks
envite

Dev and testing environment management framework

5TestingTesting Frameworks
assay

Framework-agnostic evaluation library for testing Go agents and MCP servers with deterministic checks, CI-ready exit codes, and zero-code YAML-based testing

4TestingTesting Frameworks
go-mysql-test-container

Golang MySQL testcontainer to help with MySQL integration testing

3TestingTesting Frameworks
prettycov

Draws a Go coverage profile as a package tree with a total on every row

3TestingTesting Frameworks
omg.testingtools

The simple library for change a values of private fields for testing

1TestingTesting Frameworks
coverage

A simple Web UI for Go test coverage, and the [go-test-coverage-html-report](https://github.com/marketplace/actions/go-test-coverage-html-report) reusable GitHub Action

1TestingTesting Frameworks
httper

CLI runner for JetBrains .http files with scripting, assertions, gRPC, and load testing

1TestingTesting Frameworks
gomocker

A live mocker library for functions and methods in Golang for unit testing with fluent syntax, no code-gen needed

1TestingMock
go-mutesting

Mutation testing for Go source code

TestingTesting Frameworks