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.

92

1.30x
Quality

93%

Does it follow best practices?

Impact

90%

1.30x

Average score across 3 eval scenarios

SecuritybySnyk

Passed

No known issues

SKILL.md
Quality
Evals
Security

Evaluation results

90%

34%

assert vs require usage and error assertions

Criteria
Without context
With context

assert.New usage

0%

100%

require.New usage

0%

100%

Named `is`

0%

100%

Named `must`

0%

100%

require for error checks

80%

100%

require for nil guards

80%

100%

assert for value checks

100%

100%

ErrorIs for sentinel errors

40%

100%

Correct argument order

100%

100%

testing.T entry point

100%

100%

ErrorContains or ErrorAs

80%

0%

80%

5%

mock definition, expectations, and verification

Criteria
Without context
With context

Embed mock.Mock

100%

100%

m.Called() in methods

100%

100%

AssertExpectations called

58%

66%

mock.Anything used appropriately

50%

100%

Specific matcher for email

100%

100%

Once/Times call modifier

100%

100%

Retry scenario uses chained Once()

100%

100%

AssertNotCalled usage

100%

100%

assert.New / require.New naming

0%

0%

require for error precondition

100%

100%

No extra mock.Mock field

100%

100%

Run side-effect used

0%

0%

100%

22%

test suite lifecycle and structure

Criteria
Without context
With context

suite.Suite embedded

100%

100%

Launcher function present

100%

100%

SetupTest initializes mock

100%

100%

SetupTest rebuilds service

100%

100%

AssertExpectations in tests

100%

100%

s.Require() for guards

0%

100%

Suite assertions for verifications

100%

100%

SetupSuite used appropriately

100%

100%

TearDownTest or TearDownSuite

0%

100%

Test method naming

100%

100%

mock.Anything for context

0%

100%

No missing launcher silent pass

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.