CheckOps home

Tools directory

T

CheckOps

Testify

Testify is an MIT-licensed Go toolkit with assert and require assertion packages, mock objects and test suites, the most widely used testing library in the Go ecosystem.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

Introduction

Testify is a set of Go packages that extend the standard testing package, and with about 26,000 GitHub stars it is the most popular Go testing library. It adds readable assertions, mocks and suite support while keeping the standard go test workflow.

The assert package provides functions such as assert.Equal, assert.NoError, assert.Contains, assert.Len and assert.ElementsMatch, printing clear diffs on failure and continuing the test. The require package offers the same functions but stops the test immediately, useful when later steps depend on earlier ones. The mock package lets you build mock objects by embedding mock.Mock, setting expectations with On(...).Return(...) and verifying with AssertExpectations; the separate mockery tool can generate these mocks from interfaces. The suite package supports struct-based suites with setup and teardown methods. Version 1.12.1 was released on 19 August 2026.

The source code is at stretchr/testify on GitHub under the MIT licence, with about 26,200 stars; the most recent commit was on 9 November 2026.

Features

  1. Readable assertions: assert and require with clear diffs.
  2. Mocks: mock.Mock with expectations and argument matchers.
  3. Suites: Setup and teardown around grouped tests.
  4. Standard workflow: Runs with plain go test.

Pros

  1. Free to use: Open source under the MIT licence, so the core tool costs nothing to use.
  2. Actively maintained: The repository had commits as recent as 9 November 2026.
  3. Community: About 26,200 GitHub stars.

Cons

  1. Non-idiomatic for some: Some Go developers prefer plain if checks or go-cmp.
  2. Manual mocks: Mocks are verbose without a generator such as mockery.
import (
    "testing"
    "github.com/stretchr/testify/assert"
    "github.com/stretchr/testify/require"
)

func TestCreateOrder(t *testing.T) {
    order, err := CreateOrder([]Item{{SKU: "A", Qty: 2}})
    require.NoError(t, err)
    assert.Equal(t, 2, order.Items[0].Qty)
    assert.NotEmpty(t, order.ID)
}

Resources:

Pricing

Testify is free and open source under the MIT licence.

  1. Go teams wanting concise assertions and simple mocks.
  2. Developers coming from xUnit-style frameworks.

Conclusion

Testify is the most widely used Go testing library, adding readable assertions, mocks and suites on top of the standard toolchain.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with Testify side by side.