Skip to content

Function: launchInkFixture()

@termwright/ink


@termwright/ink / launchInkFixture

launchInkFixture(options): Promise<InkFixtureHarness>

Defined in: ink/src/fixture.ts:131

Starts a fixture process in a real pty and returns a harness over it.

The fixture renders component’s export with normal Ink under the same injected probe a production app uses, in the alternate screen, so its tree matches what mountInk produces for the same element.

LaunchInkFixtureOptions

Promise<InkFixtureHarness>

const harness = await launchInkFixture({
component: new URL('./counter-app.mjs', import.meta.url),
props: { label: 'Approve' },
columns: 40,
rows: 10,
});
await harness.press('Enter');
await harness.waitForText('pressed 1');
await harness.close();