Назад към всички

tui-test-renderer

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

$ git log --oneline --stat
stars:384
forks:73
updated:March 4, 2026
SKILL.mdreadonly
SKILL.md Frontmatter
nametui-test-renderer
descriptionSet up testing utilities for TUI components with ink-testing-library and Bubble Tea testing.
allowed-toolsRead, Write, Edit, Bash, Glob, Grep

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