CtrlK
BlogDocsLog inGet started
Tessl Logo

golang-stretchr-testify

Comprehensive guide to stretchr/testify for Golang testing. Covers assert, require, mock, and suite packages in depth. Use whenever writing tests with testify, creating mocks, setting up test suites, or choosing between assert and require. Essential for testify assertions, mock expectations, argument matchers, call verification, suite lifecycle, and advanced patterns like Eventually, JSONEq, and custom matchers. Trigger on any Go test file importing testify.

87

1.67x
Quality

89%

Does it follow best practices?

Impact

77%

1.67x

Average score across 3 eval scenarios

SecuritybySnyk

Passed

No known issues

SKILL.md
Quality
Evals
Security

Evaluation results

90%

79%

Payment Gateway Integration Tests

Mock setup, matchers, and retry sequences

Criteria
Without context
With context

Mock embeds mock.Mock

0%

100%

m.Called() forwarding

0%

100%

mock.Anything usage

0%

100%

mock.AnythingOfType usage

0%

0%

mock.MatchedBy predicate

0%

100%

Retry: first call fails with .Once()

0%

100%

Retry: second call succeeds with .Once()

0%

100%

AssertExpectations called

0%

100%

Call count verification

30%

100%

Error assertions use NoError/ErrorIs

100%

100%

84%

Migrating User Repository Tests to a Testify Suite

Test suite lifecycle and launcher

Criteria
Without context
With context

suite.Suite embedded

100%

100%

Launcher function present

100%

100%

SetupTest for per-test init

100%

100%

SetupSuite for one-time setup

100%

100%

TearDown methods present

0%

0%

Test methods on suite receiver

100%

100%

s.Require() for preconditions

100%

100%

s.Equal/s.NoError for verifications

100%

100%

All original tests covered

100%

100%

No standalone test functions

0%

0%

57%

14%

Testing an Async Notification Delivery Service

Assert/require naming, async polling, wrapped errors

Criteria
Without context
With context

'is' naming for assert

0%

100%

'must' naming for require

0%

0%

require for error/nil preconditions

80%

70%

assert for value verifications

75%

87%

EventuallyWithT (not Eventually)

0%

0%

CollectT callback parameter

0%

0%

Multiple assertions in callback

0%

0%

ErrorIs for wrapped errors

41%

100%

Pointer-safe struct comparison

100%

100%

Correct argument order

100%

100%

Repository
samber/cc-skills-golang
Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.