Function: prettyWidget()
prettyWidget(
container,options):string
Defined in: pretty-widget.ts:176
Formats a widget tree as a readable string for debugging.
Renders the widget hierarchy in an HTML-like format with accessibility attributes like role, data-testid, and text content.
Parameters
| Parameter | Type | Description |
|---|---|---|
container | Container | The container widget or application to format |
options | PrettyWidgetOptions | Formatting options for length and highlighting |
Returns
string
Formatted string representation of the widget tree
Example
import { prettyWidget } from "@gtkx/testing";
console.log(prettyWidget(application));
// Output:
// <GtkApplicationWindow role="window">
// <GtkButton role="button">
// Click me
// </GtkButton>
// </GtkApplicationWindow>