What problem does it solve?
It helps Go developers write maintainable tests by providing consistent, readable assertion patterns, safe precondition handling, and reliable mocking/suite structure using stretchr/testify.
Core Features & Use Cases
- assert vs require discipline: use
require for fail-fast preconditions and assert for continued verifications to avoid nil panics and misleading follow-up errors.
- Rich assertions for complex checks: equality variants, JSON comparison, async polling via Eventually/EventuallyWithT, and duration/regexp validations.
- testify/mock correctness: define expectations with
mock.Mock, match arguments with built-in and predicate matchers, and verify calls with AssertExpectations(t).
- testify/suite organization: group related tests with shared setup/teardown while keeping per-test initialization predictable through SetupTest.
Quick Start
Use this skill when your Go codebase already imports github.com/stretchr/testify and you need to write or review tests involving assertions, mocks, suites, or async polling.