Interface: TerminalFactory
@termwright/test / TerminalFactory
Interface: TerminalFactory
Section titled “Interface: TerminalFactory”Defined in: test/src/fixtures.ts:134
Launches terminals that close themselves when the test ends.
Properties
Section titled “Properties”
readonlylogs:LogCollection
Defined in: test/src/fixtures.ts:151
Everything the programs of this test logged, oldest first.
sessions
Section titled “sessions”
readonlysessions: readonlyTerminalHarness[]
Defined in: test/src/fixtures.ts:147
Sessions launched by this test, in launch order.
tmpdir
Section titled “tmpdir”
readonlytmpdir:string
Defined in: test/src/fixtures.ts:149
The test’s private working directory.
Methods
Section titled “Methods”attach()
Section titled “attach()”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.
Type Parameters
Section titled “Type Parameters”T extends TerminalHarness
Parameters
Section titled “Parameters”harness
Section titled “harness”T
options?
Section titled “options?”Returns
Section titled “Returns”Promise<T>
failOnLogLevel()
Section titled “failOnLogLevel()”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.
Parameters
Section titled “Parameters”false | "trace" | "debug" | "info" | "warn" | "error" | "fatal"
Returns
Section titled “Returns”void
launch()
Section titled “launch()”launch(
options?):Promise<TerminalHarness>
Defined in: test/src/fixtures.ts:135
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Promise<TerminalHarness>
openShell()
Section titled “openShell()”openShell(
options?):Promise<TerminalHarness>
Defined in: test/src/fixtures.ts:137
Opens an interactive shell with exact command boundaries.
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Promise<TerminalHarness>