What problem does it solve?
It helps Go engineers write reliable, readable unit tests using stretchr/testify by standardizing assertion behavior, mock verification, and suite lifecycle patterns.
Core Features & Use Cases
- assert vs require guidance: Use require for preconditions to stop early and assert for verifications so failures are aggregated.
- High-signal assertions: Prefer correct equality semantics, richer matchers (JSONEq, Regexp, ElementsMatch), and correct argument ordering for better diffs.
- testify/mock correctness: Set expectations with argument matchers and always verify with AssertExpectations to avoid silent false positives.
- testify/suite structure: Organize related tests with shared setup/teardown and per-test initialization using SetupTest.
- Async test polling: Use EventuallyWithT with CollectT to make multiple assertions during polling without losing error context.
Quick Start
Use the golang-stretchr-testify skill to generate a Go test plan that uses assert.New for verifications, require.New for guard checks, and testify/mock with proper AssertExpectations, tailored to how the codebase imports github.com/stretchr/testify.