ReferencePackages
@mwillbanks/tuil-testing-ink
Ink-backed renderer and interaction harness for testing tuil applications.
Overview
Ink-backed renderer and interaction harness for testing tuil applications.
@mwillbanks/tuil-testing-ink is independently installable and also participates in the
umbrella @mwillbanks/tuil runtime where applicable.
Installation
npm install @mwillbanks/tuil-testing-inkHow it operates
The Ink test renderer creates a real tuil runtime and semantic registry around ink-testing-library, then coordinates input, resize, frame, event, focus, and cleanup helpers.
API
| API | Signature | Description |
|---|---|---|
cleanup | function cleanup | Public function cleanup. |
clickPointerTarget | function clickPointerTarget | Public function clickPointerTarget. |
dragPointerTarget | function dragPointerTarget | Public function dragPointerTarget. |
normalizeTerminalFrame | export normalizeTerminalFrame | Public export normalizeTerminalFrame. |
renderTuil | function renderTuil | Public function renderTuil. |
screen | constant screen | Public constant screen. |
SemanticScreen | export SemanticScreen | Public export SemanticScreen. |
TuilTestInstance | interface TuilTestInstance | Public interface TuilTestInstance. |
TuilUser | class TuilUser | Public class TuilUser. |
user | constant user | Public constant user. |
Events and lifecycle
Tests can inspect event history and wait on rendered state after input settles.
All subscriptions and registrations return a disposer or belong to an owning runtime that disposes them in reverse order.
Example
import { renderTuil } from "@mwillbanks/tuil-testing-ink";
const view = renderTuil(<Button id="run">Run</Button>);
await view.press("enter");