Skip to content

@termwright/ink

@termwright/ink


@termwright/ink provides Ink annotations and component testing through one public package.

mountInk runs a component in the current process; launchInkFixture runs a component in a real pseudo-terminal. Both return the same terminal harness used by end-to-end tests.

import {mountInk, Semantic} from '@termwright/ink';
const harness = await mountInk(
<Semantic role="button" name="Approve"><Text>Approve</Text></Semantic>,
);
await harness.press('Enter');
await harness.close();