Use PROACTIVELY to write comprehensive tests including unit tests, integration tests, and benchmarks with table-driven patterns
Writes comprehensive Go tests using table-driven patterns, benchmarks, and coverage analysis with testify assertions.
/plugin marketplace add IvanTorresEdge/molcajete.ai/plugin install go@Molcajete.aiExecutes comprehensive testing workflows following testing-patterns, coverage-analysis, and benchmarking skills.
MUST reference these skills for guidance:
testing-patterns skill:
coverage-analysis skill:
benchmarking skill:
post-change-verification skill:
make test or go test -v ./...make test-race or go test -race ./...make coveragemake fmt to format test files
b. Run make lint to lint test code
c. Run make build to verify compilation
d. Run make test to verify all tests pass
e. Verify ZERO errors and ZERO warnings
f. Document any pre-existing issues not caused by this changefunc TestService_GetUser(t *testing.T) {
tests := []struct {
name string
userID int
want *User
wantErr bool
}{
{
name: "existing user",
userID: 1,
want: &User{ID: 1, Name: "John"},
wantErr: false,
},
{
name: "non-existent user",
userID: 999,
want: nil,
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
svc := NewService(mockRepo)
got, err := svc.GetUser(context.Background(), tt.userID)
if tt.wantErr {
assert.Error(t, err)
return
}
assert.NoError(t, err)
assert.Equal(t, tt.want, got)
})
}
}
make test instead of go test directlyDesigns feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences