Skip to content

API Reference / @gtkx/testing / PrettyWidgetOptions

Type Alias: PrettyWidgetOptions ​

PrettyWidgetOptions = object

Defined in: packages/testing/src/pretty-widget.ts:17

Options controlling how a widget tree is rendered to a string by prettyWidget and logWidget.

Properties ​

getId? ​

optional getId?: WidgetIdResolver

Defined in: packages/testing/src/pretty-widget.ts:23

Resolves an id attribute to show for each widget.


maxDepth? ​

optional maxDepth?: number

Defined in: packages/testing/src/pretty-widget.ts:25

Stops descending past this depth, replacing deeper children with a summary line.


maxLength? ​

optional maxLength?: number

Defined in: packages/testing/src/pretty-widget.ts:19

Truncates the output once it exceeds this many characters.


prettyFormatOptions? ​

optional prettyFormatOptions?: PrettyFormatOptions

Defined in: packages/testing/src/pretty-widget.ts:27

Forwarded to pretty-format, which does the printing; indent and min shape the layout.


shouldHighlight? ​

optional shouldHighlight?: boolean

Defined in: packages/testing/src/pretty-widget.ts:21

Whether to apply ANSI color highlighting; defaults to the terminal capabilities.