Skip to content

API Reference / @gtkx/vitest / default

Function: default() ​

default(options?): Plugin

Defined in: packages/vitest/src/index.ts:40

Vitest plugin that runs each test worker against its own isolated headless Wayland display. It configures the forks pool, injects the worker preload and setup files, and sets the environment needed for headless GTK4 rendering.

Each worker's compositor, session bus, and private runtime directory are torn down when the worker exits, and a guard process tears them down as well when the worker or the Vitest process that launched it is killed with SIGKILL. Creating the plugin reaps stale gtkx-xdg-* runtime directories left behind by earlier runs, which gtkx cleanup also does on demand.

Parameters ​

options? ​

PluginOptions = {}

Headless display settings (size, compositor) forwarded to each worker.

Returns ​

Plugin

A Vitest config plugin.