go-testing

Implement table-driven Go tests for Bubbletea UIs with teatest and golden-file verification.

1|1|Updated Apr 19, 2026
One-click install
npx skills add https://github.com/RamonsDka/the-architect-overlay --skill go-testing-ramonsdka
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-testing
Source: https://github.com/RamonsDka/the-architect-overlay/tree/main/skills/go-testing
Command: npx skills add https://github.com/RamonsDka/the-architect-overlay --skill go-testing-ramonsdka

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go testing patterns for Go projects, including Bubbletea UI components and teatest integration, streamline reliable test design and execution.

Core Features & Use Cases

  • Table-driven tests for robust coverage across input variants.
  • Bubbletea model and UI testing patterns to validate state transitions and rendering.
  • Teatest integration guidance for end-to-end TUI flows and golden-file verification.

Quick Start

Implement a small suite of unit tests using table-driven patterns for your Go codebase.

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 tests for Go projects?

Table-driven tests in Go projects are implemented by defining input variants in a struct slice and iterating over them to execute consistent test logic. This pattern provides robust coverage across multiple input combinations without duplicating test code.

How does teatest integration work for Bubbletea UI testing?

Teatest integration for Bubbletea UI testing works by validating state transitions and rendering output during end-to-end TUI flows. It allows you to programmatically send inputs to your Bubbletea model and assert the resulting UI state and terminal output.

What is golden-file testing and when do I need it in Go?

Golden-file testing in Go is a deterministic verification approach that compares test output against a saved reference file. You need it when validating complex or large outputs like TUI rendering, ensuring they remain stable across code changes without writing manual assertions.

Can I use this to test Bubbletea model state transitions directly?

Yes, you can test Bubbletea model state transitions directly by applying dedicated model testing patterns. These patterns validate state changes and rendering outputs by inspecting the model's internal state and view output after processing specific program messages.

What is the best way to verify deterministic output in TUI apps?

The best way to verify deterministic output in TUI apps is using golden-file testing combined with teatest integration. This approach captures terminal rendering into a reference file and compares subsequent test runs against it to detect unintended UI changes.

Why do my Bubbletea UI tests have inconsistent rendering results?

Inconsistent Bubbletea UI test rendering often results from non-deterministic outputs or direct terminal dependencies. Applying teatest integration with golden-file verification isolates the TUI environment and standardizes output comparison to ensure reliable test execution.