testify

Solid

Testing toolkit with assertions, mocks, and suites.

Testing & QA 183 stars 39 forks Updated 1 months ago MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
75
Recency 20%
75
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Testify Standards ## Assert Package ```go import ( "testing" "github.com/stretchr/testify/assert" ) func TestSomething(t *testing.T) { // Equality assert.Equal(t, 123, result) assert.NotEqual(t, 456, result) // Boolean assert.True(t, ok) assert.False(t, failed) // Nil checks assert.Nil(t, err) assert.NotNil(t, obj) // Error checks assert.NoError(t, err) assert.Error(t, err) assert.ErrorIs(t, err, ErrNotFound) assert.ErrorContains(t, err, "not found") // Collections assert.Contains(t, slice, item) assert.Len(t, slice, 3) assert.Empty(t, slice) assert.NotEmpty(t, slice) assert.ElementsMatch(t, expected, actual) // Order independent // Comparison assert.Greater(t, 2, 1) assert.GreaterOrEqual(t, 2, 2) assert.Less(t, 1, 2) // Type assertions assert.IsType(t, &User{}, obj) assert.Implements(t, (*io.Reader)(nil), obj) // With message assert.Equal(t, expected, actual, "values should match") } ``` ## Require Package ```go import "github.com/stretchr/testify/require" func TestWithRequire(t *testing.T) { // Stops test immediately on failure user, err := GetUser(1) require.NoError(t, err) // Fails here stops test require.NotNil(t, user) // Continue knowing user is valid assert.Equal(t, "John", user.Name) } ``` ## Mock Package ```go import ( "testing" "github.com/stretchr/testify/mock" ) // Interface to mock t...

Details

Author
majiayu000
Repository
majiayu000/claude-skill-registry
Created
5 months ago
Last Updated
1 months ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Listed

testify

Testing toolkit with assertions, mocks, and suites.

3 Updated 1 months ago
majiayu000
Testing & QA Listed

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.

0 Updated today
guynhsichngeodiec
Testing & QA Solid

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.

1,904 Updated 3 days ago
samber
Testing & QA Listed

go-testing

Go testing patterns from Google and Uber style guides including test naming, table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions. Use when writing or reviewing Go test code, creating test helpers, or setting up table-driven tests.

0 Updated today
dwana1
Testing & QA Listed

testing

Use when writing, reviewing, or improving tests, deciding what to mock, or designing interfaces for testability.

4 Updated 2 days ago
juanibiapina