go-testing

Write structured Go tests for Bubbletea UIs with table-driven and golden-file patterns.

Updated Feb 1, 2026
One-click install
npx skills add https://github.com/adacosdev/dotfiles --skill go-testing-adacosdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-testing
Source: https://github.com/adacosdev/dotfiles/tree/main/dot_config/opencode/skills/go-testing
Command: npx skills add https://github.com/adacosdev/dotfiles --skill go-testing-adacosdev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go testing in Bubbletea-based UIs can be verbose and brittle; this guide provides a structured set of patterns to streamline unit and UI testing.

Core Features & Use Cases

  • Table-driven tests for Go units, including edge cases.
  • Bubbletea model and update testing patterns for deterministic state validation.
  • Teatest integration guidance and golden-file style checks for stable visual output.
  • Best practices for mocking, integration testing, and evolving test suites.

Quick Start

Run go test using the provided patterns to validate your Bubbletea-based components.

Frequently Asked Questions about go-testing

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

FAQPage Schema
How do I write reliable unit tests for Go Bubbletea TUI applications?

To write reliable Go tests for Bubbletea TUI applications, use structured testing patterns that include table-driven tests for edge cases, model testing for deterministic state validation, and teatest integration for stable visual output verification.

What is the best way to test Bubbletea model updates in Go?

The best way to test Bubbletea model updates is by applying structured model testing patterns that validate deterministic state changes, ensuring your update logic produces consistent and predictable results across different inputs.

Can I use golden-file checks to verify Bubbletea UI output?

Yes, you can use golden-file style checks with teatest integration to verify Bubbletea UI output, ensuring stable and deterministic visual rendering across code changes without brittle manual comparisons.

How does teatest integration work for Go TUI testing?

Teatest integration works by providing a framework to run Bubbletea-based UIs in tests, capturing their visual output, and comparing it against golden files or expected states for deterministic validation.

Do I need to mock dependencies for Bubbletea unit tests in Go?

While mocking is supported as a best practice for isolating components, table-driven tests and model testing patterns allow you to validate deterministic state transitions and logic without extensive mocking overhead.

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

Bubbletea TUI tests become brittle without structured patterns; fix them by adopting table-driven tests, deterministic model state validation, and teatest golden-file checks to ensure stable visual output.