Skip to content
Agentmart
Submit a tool

go-testing

Go and Bubbletea testing patterns for this repo.

Skill by martinhg

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/martinhg-go-testing

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Go and Bubbletea testing patterns for this repo. Trigger: writing or reviewing tests, golden files, or coverage.

Use cases: testing, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/go-testing

What's inside

Skill name
go-testing
Description
Go and Bubbletea testing patterns for this repo. Trigger: writing or reviewing tests, golden files, or coverage.
License
MIT
Instructions
23 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

## Patterns

- **Table-driven** tests for multiple cases; name cases by scenario, use `t.Run`.
- **Filesystem**: always `t.TempDir()`; never touch the real home directory.
- **Seams over mocks**: swap package-level function vars (e.g. `lookPath`,
  `userHomeDir`, `runVersion`, `runInstall`, `reExec`) and restore via
  `t.Cleanup`. This is how exec/network/home paths are tested here.

## Bubbletea / TUI

- Test state transitions by calling `Model.Update(msg)` directly with a `tea.Msg`
  (use the `key(...)` helper for `tea.KeyMsg`). Assert the returned screen, state,
  and emitted `tea.Cmd` (call `cmd()` and type-assert the message).
- Test rendered output with **golden files** (`golden(t, name, view)`); update via
  `go test ./internal/tui -update` and inspect the diff.
- Keep screen tests **hermetic** — build the screen struct directly when you only
  need navigation, so you don't trigger real detection/exec.

## Run

- Run the narrow package first, then `go test -race ./...` before a PR.

From martinhg/capiko-ai, MIT.

More from martinhg/capiko-ai

Signals

Stars
2
Forks
0
Open issues
1
Last commit (this folder)
Jun 6, 2026 (4 months ago)
Last release
Oct 13, 2026 (16 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from martinhg

Cite this page

go-testing skill. Agent Mart. https://agentmart.dev/skills/martinhg-go-testing (last updated 2026-10-24)