go-testing

Automate Go testing patterns for Bubbletea applications with teatest and golden files.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/TrollHeap/dotfiles --skill go-testing-trollheap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-testing
Source: https://github.com/TrollHeap/dotfiles/tree/main/ai-config/.claude/templates/bubbletea/.claude/skills/go-testing
Command: npx skills add https://github.com/TrollHeap/dotfiles --skill go-testing-trollheap

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go testing for Bubbletea-based applications can be error-prone and hard to structure; this Skill codifies established patterns to validate UI state, model updates, and integration flows.

Core Features & Use Cases

  • Table-Driven Tests for comprehensive coverage of multiple inputs.
  • Bubbletea Model Testing for direct state transition verification.
  • Teatest Integration Tests for end-to-end UI interaction flows.
  • Golden File Testing for stable, diffable outputs.
  • Guidance on test organization, patterns, and best practices for Go tests.

Quick Start

Run the teatest-based tests for your Bubbletea models to validate state transitions and output.

Frequently Asked Questions about go-testing

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

FAQPage Schema
How do I test Bubbletea models in Go to verify state transitions?

Test Bubbletea models by directly verifying state transitions and UI updates. This approach validates how your model processes update messages, ensuring your application logic behaves correctly without manual interaction.

How do I write table-driven tests for Go TUI components?

Write table-driven tests to achieve comprehensive coverage across multiple inputs for your Go components. This pattern structures your test cases systematically, verifying diverse scenarios and edge cases efficiently within a single test function.

Can I use teatest for integration testing Bubbletea applications?

Yes, teatest enables integration testing for Bubbletea applications to validate end-to-end UI interaction flows. It programmatically simulates user inputs and asserts resulting outputs, verifying full interaction sequences.

What are golden file tests in Go and when do I need them?

Golden file tests capture expected output snapshots for stable, diffable verifications in Go. You need them when validating complex outputs, allowing you to detect unintended changes by diffing actual results against saved golden files.

What is the best way to structure Go tests for TUI apps?

Structure Go tests for TUI apps by combining table-driven tests, model testing, and teatest integration flows. This layered pattern separates logic verification from end-to-end UI flows, ensuring robust validation across your application.

Does this Go testing approach work without external dependencies?

Yes, these Go testing patterns require no external dependencies beyond the standard testing library, teatest, and Bubbletea. You can apply these model and golden file verification techniques directly within your existing project setup.