unit-testing-testify
CommunityMaster Go unit tests with testify.
Authormanorfm
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Este Skill facilita a criação e a estruturação de testes unitários em Go, promovendo práticas consistentes com o uso do pacote testify, aumentando a confiabilidade do código e reduzindo retrabalho.
Core Features & Use Cases
- Utilize testify: Use o pacote assert do github.com/stretchr/testify/assert para asserções mais legíveis e concisas.
- Nomenclatura: Coloque seus testes no arquivo adjunto ex: toggle_usecase_test.go para o arquivo toggle_usecase.go.
- Estrutura Table-Driven: Para métodos com múltiplos caminhos (Sucesso vs. Falhas), organize usando Table-Driven Tests ([]struct{...}).
- Mocks: Sempre utilize mocks (testify/mock) para isolar camadas. Exemplo: para testar um Usecase, implemente seu Repository como Mock para simular respostas.
Quick Start
Escreva testes unitários table-driven para um usecase específico usando testify e mocks.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: unit-testing-testify Download link: https://github.com/manorfm/toToggles/archive/main.zip#unit-testing-testify Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.