Skip to content

Interface: TerminalFactory

@termwright/test


@termwright/test / TerminalFactory

Defined in: test/src/fixtures.ts:134

Launches terminals that close themselves when the test ends.

readonly logs: LogCollection

Defined in: test/src/fixtures.ts:151

Everything the programs of this test logged, oldest first.


readonly sessions: readonly TerminalHarness[]

Defined in: test/src/fixtures.ts:147

Sessions launched by this test, in launch order.


readonly tmpdir: string

Defined in: test/src/fixtures.ts:149

The test’s private working directory.

attach<T>(harness, options?): Promise<T>

Defined in: test/src/fixtures.ts:145

Adopts an existing harness for this test.

The fixture collects its logs, publishes it to the Runner, records its trace, and closes it during teardown. This works with every component helper that returns the shared TerminalHarness contract.

T extends TerminalHarness

T

AttachFixtureOptions

Promise<T>


failOnLogLevel(level): void

Defined in: test/src/fixtures.ts:158

Overrides TermwrightConfig.failOnLogLevel for this test.

false accepts whatever the program logs — the escape hatch for a test that expects an error path to be exercised.

false | "trace" | "debug" | "info" | "warn" | "error" | "fatal"

void


launch(options?): Promise<TerminalHarness>

Defined in: test/src/fixtures.ts:135

LaunchFixtureOptions

Promise<TerminalHarness>


openShell(options?): Promise<TerminalHarness>

Defined in: test/src/fixtures.ts:137

Opens an interactive shell with exact command boundaries.

OpenShellFixtureOptions

Promise<TerminalHarness>