← ClaudeAtlas

write-go-testslisted

Test conventions for ALL Go code in the a-novel and a-novel-kit organizations — file/function naming, table-driven structure, mockery, assertions, parallelism, cross-package fixtures, helpers, coverage. Load it whenever writing or modifying a Go test file in a backend service OR a shared library. Pairs with `write-go`; layer-specific patterns live in `write-go-service`. Does NOT apply to JS/TS tests.
a-novel-kit/stack · ★ 1 · Testing & QA · score 67
Install: claude install-skill a-novel-kit/stack
# Go Test Conventions This skill governs Go tests across every a-novel / a-novel-kit repository, services and shared libraries alike. Tests define behavior, document contracts, and guard against regressions; they must be clear, isolated, and exhaustive for the paths they cover. Load it alongside `write-go` (base Go conventions) and the repo-kind skill, `write-go-service` or `write-go-kit`. **Before writing any test**, read the existing tests in the same package. Patterns are consistent by design — follow them exactly. Read the production code under test too; do not guess at behavior or signatures. **Look up the testing libraries online.** Check the official docs and real usage of `testify`, `httptest`, `mockery`, or any other helper before writing — above all for mock assertion patterns (`EXPECT`, `.Once()`, `mock.MatchedBy`) and JSON comparison utilities. Misuse yields silent false-positives and missed failures. **Never remove existing tests** unless the feature they cover is fully deprecated and removed from the codebase. Fix a stale or failing test; do not delete it. --- ## After every edit Run the narrowest test target that exercises the code you changed: ``` a-novel test --type=go -y # auto-discovers Go tests: services' internal/ + pkg/go, libraries' packages a-novel test -y # add pnpm too (services with pkg/js) # Iterating on a single package — raw go test stays valid for the tight loop: go test ./internal/dao/... -run TestJwkSelect ``` During in