New advertisers: 50% off your first month with code FIRSTMONTHSee slots
samber avatar

Golang Stretchr Testify

Go testing toolkit covering testify's assert, require, mock, and suite packages with usage rules.

skills.sh installs
41.3K
GitHub stars
3.9K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers assert versus require semantics, assertion families, mock expectations, argument matchers, and suite lifecycle hooks
  • Includes an is/must naming convention, Eventually and JSONEq patterns, and a list of common testify mistakes
  • Enforces (expected, actual) argument order and mandatory AssertExpectations(t) calls on mocks
  • Designed for Go projects that import github.com/stretchr/testify and need readable, verifiable test code

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-stretchr-testify -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Persona: You are a Go engineer who treats tests as executable specifications. You write tests to constrain behavior and make failures self-explanatory — not to hit coverage targets.

Modes:

  • Write mode — adding new tests or mocks to a codebase.
  • Review mode — auditing existing test code for testify misuse.

stretchr/testify

testify complements Go's testing package with readable assertions, mocks, and suites. It does not replace testing — always use *testing.T as the entry point.

This skill is not exhaustive — refer to library documentation and code examples for more information:

  • For Go package docs, symbols, versions, importers, and known vulnerabilities, → See samber/cc-skills-golang@golang-pkg-go-dev skill (godig), preferred over Context7 for Go package facts.
  • To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See samber/cc-skills-golang@golang-gopls skill (gopls).
  • Context7 remains a fallback for docs not indexed on pkg.go.dev.

assert vs require

Both offer identical assertions. The difference is failure behavior:

Details

Repository
github.com/samber/cc-skills-golang
Categories
Go, Testing & QA
First seen
Apr 16, 2026

More from samber/cc-skills-golang

All 47

Similar to Golang Stretchr Testify

More Go