go-testing

Generate table-driven Go unit tests and Bubbletea teatest examples for Model.Update state transitions.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/sebasmzg/sebas.dot --skill go-testing-sebasmzg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-testing
Source: https://github.com/sebasmzg/sebas.dot/tree/main/.config/opencode/skills/go-testing
Command: npx skills add https://github.com/sebasmzg/sebas.dot --skill go-testing-sebasmzg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill consolidates practical patterns and examples to reduce guesswork and brittle tests when writing Go unit tests and Bubbletea TUI tests, making tests easier to write, understand, and maintain.

Core Features & Use Cases

  • Table-driven tests: Clear patterns for iterating multiple cases with subtests and concise assertions.
  • Bubbletea model testing: Techniques to exercise Model.Update, simulate key messages, and assert state transitions deterministically.
  • Teatest and integration flows: Example usages of teatest for interactive flow testing and guidance for golden file comparisons and integration test organization.

Quick Start

Generate table-driven Go unit tests and Bubbletea teatest examples for a Model.Update function to validate state transitions and view output.

Frequently Asked Questions about go-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write table-driven unit tests in Go with subtests?

Table-driven unit tests in Go iterate through struct cases via subtests to run multiple scenarios with concise assertions. This skill provides clear patterns for structuring test data, executing subtests, and validating outputs to reduce guesswork and avoid brittle tests.

How do I test Bubbletea model.Update state transitions deterministically?

Testing Bubbletea model.Update state transitions involves simulating key messages and asserting resulting state changes deterministically. This skill provides techniques to exercise Model.Update, send specific inputs, and validate that the resulting model state matches expected outcomes.

What is the best way to use teatest for Bubbletea integration testing?

Using teatest for Bubbletea integration testing allows you to simulate interactive flows and validate view output. This skill offers example usages of teatest to automate TUI interactions, test complete integration flows, and organize integration tests for installer TUI code effectively.

How do golden file comparisons work in Go testing?

Golden file comparisons in Go testing work by saving expected output to a file and comparing future test results against it. This skill provides guidance on managing golden files, updating expected outputs, and using them for deterministic view assertions in teatest integration flows.

Can I mock side effects in Go unit tests for installer TUI code?

Yes, you can mock side effects in Go unit tests for installer TUI code to ensure deterministic model state assertions. This skill satisfies technical needs for using the Go testing package to mock side effects, isolate dependencies, and validate complex integration test scenarios.

Why are my Bubbletea TUI tests brittle and how can I fix them?

Bubbletea TUI tests become brittle due to improper state assertions and unhandled side effects. This skill consolidates practical patterns to reduce guesswork by providing reliable testing techniques, deterministic model state assertions, and teatest integration flows for maintainable tests.