ReferencePackages
@mwillbanks/tuil-testing
Semantic assertions, screens, and portable story contracts for testing tuil applications.
Overview
Semantic assertions, screens, and portable story contracts for testing tuil applications.
@mwillbanks/tuil-testing is independently installable and also participates in the
umbrella @mwillbanks/tuil runtime where applicable.
Installation
npm install @mwillbanks/tuil-testingHow it operates
Testing contracts query semantic output instead of terminal coordinates, define portable stories, and provide screen-style role, label, state, and text assertions.
API
| API | Signature | Description |
|---|---|---|
defaultTerminalStoryControls | constant defaultTerminalStoryControls | Public constant defaultTerminalStoryControls. |
defineTuilStories | function defineTuilStories | Public function defineTuilStories. |
normalizeTerminalFrame | function normalizeTerminalFrame | Public function normalizeTerminalFrame. |
QueryableSemanticNode | interface QueryableSemanticNode | Public interface QueryableSemanticNode. |
SemanticQuery | interface SemanticQuery | Public interface SemanticQuery. |
SemanticScreen | class SemanticScreen | Public class SemanticScreen. |
SemanticSnapshot | interface SemanticSnapshot | Public interface SemanticSnapshot. |
TerminalStoryControls | interface TerminalStoryControls | Public interface TerminalStoryControls. |
TuilStory | interface TuilStory | Public interface TuilStory. |
TuilStoryDefinition | interface TuilStoryDefinition | Public interface TuilStoryDefinition. |
Events and lifecycle
Story and test results expose captured runtime events for deterministic assertions.
All subscriptions and registrations return a disposer or belong to an owning runtime that disposes them in reverse order.
Example
expect(screen.getByRole("button", { name: "Run" })).toBeEnabled();