tuil
ReferencePackages

@mwillbanks/tuil-testing

Semantic assertions, screens, and portable story contracts for testing tuil applications.

View rawEdit

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-testing

How it operates

Testing contracts query semantic output instead of terminal coordinates, define portable stories, and provide screen-style role, label, state, and text assertions.

Documentation flow diagram. render; query semantics; interact; assert; cleanup; S0 leads to S1; S1 leads to S2; S2 leads to S3
Documentation flow diagram. render; query semantics; interact; assert; cleanup; S0 leads to S1; S1 leads to S2; S2 leads to S3

API

APISignatureDescription
defaultTerminalStoryControlsconstant defaultTerminalStoryControlsPublic constant defaultTerminalStoryControls.
defineTuilStoriesfunction defineTuilStoriesPublic function defineTuilStories.
normalizeTerminalFramefunction normalizeTerminalFramePublic function normalizeTerminalFrame.
QueryableSemanticNodeinterface QueryableSemanticNodePublic interface QueryableSemanticNode.
SemanticQueryinterface SemanticQueryPublic interface SemanticQuery.
SemanticScreenclass SemanticScreenPublic class SemanticScreen.
SemanticSnapshotinterface SemanticSnapshotPublic interface SemanticSnapshot.
TerminalStoryControlsinterface TerminalStoryControlsPublic interface TerminalStoryControls.
TuilStoryinterface TuilStoryPublic interface TuilStory.
TuilStoryDefinitioninterface TuilStoryDefinitionPublic 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();

On this page