Agent Skills: TUI Test Renderer

Set up testing utilities for TUI components with ink-testing-library and Bubble Tea testing.

UncategorizedID: a5c-ai/babysitter/tui-test-renderer

Install this agent skill to your local

pnpm dlx add-skill https://github.com/a5c-ai/babysitter/tree/HEAD/library/specializations/cli-mcp-development/skills/tui-test-renderer

Skill Files

Browse the full folder contents for tui-test-renderer.

Download Skill

Loading file tree…

library/specializations/cli-mcp-development/skills/tui-test-renderer/SKILL.md

Skill Metadata

Name
tui-test-renderer
Description
Set up testing utilities for TUI components with ink-testing-library and Bubble Tea testing.

TUI Test Renderer

Set up testing utilities for TUI components.

Generated Patterns

Ink Testing

import { render } from 'ink-testing-library';
import React from 'react';
import { MyComponent } from './MyComponent';

test('renders correctly', () => {
  const { lastFrame, stdin } = render(<MyComponent />);
  expect(lastFrame()).toContain('Expected text');
  stdin.write('\r'); // Simulate enter
  expect(lastFrame()).toContain('After enter');
});

Bubble Tea Testing

import (
  tea "github.com/charmbracelet/bubbletea"
  "testing"
)

func TestModel(t *testing.T) {
  m := initialModel()
  m, _ = m.Update(tea.KeyMsg{Type: tea.KeyEnter})
  view := m.View()
  if !strings.Contains(view, "expected") {
    t.Errorf("Expected view to contain 'expected'")
  }
}

Target Processes

  • tui-application-framework
  • cli-unit-integration-testing