Functions

f
ping(): Promise<ResponseChunk | null>

Sends a ping and resolves the daemon's pong response (or null on failure).

f
run(
options: DaemonRunOptions,
sink?: Console
): Task<RunResult, DaemonRunFailure>

Runs the suite inside the daemon and answers with the same RunResult a local run produces. The one to reach for; runArgv is the CLI's narrower variant.

f
runArgv(argv: string[]): Task<number, DaemonRunFailure>

The CLI's path: sends raw argv and answers with the exit code the daemon reported.

f
shouldAutoSpawn(): boolean

True iff the user opted in to auto-spawn (QUNITX_DAEMON=1), the invocation is daemon-eligible, and no daemon is running yet — meaning cli should spawn one before dispatching the run.

f
shouldUse(): boolean

True iff a live daemon socket exists and the invocation can use it. The cli's primary dispatch check.

f
shutdown(cwd?: string): Promise<boolean>

Sends shutdown and waits until the daemon has actually fully exited — not just until the socket closes. The daemon's dispatch handler acks 'done' before its async cleanup (server.close / browser.close / process.exit) runs, so a naive "stop returned" signal leaves the daemon's socket / named-pipe handle still held. A fast follow-up daemon start would then race the dying daemon and hit EADDRINUSE — observed reliably on Windows where named-pipe handle release lags process exit by tens of milliseconds.

f
tryConnect(cwd?: string): Promise<net.Socket | null>

Opens a connection to the daemon for the given cwd. Resolves the connected socket on success; resolves null on any failure (no socket file, ECONNREFUSED, timeout).

Type Aliases

T
DaemonRunFailure = Failure.Of<DaemonUnreachable | DaemonDisconnected | DaemonSilent>

Every way a daemon-routed run can fail to produce an exit code.

Variables

v
DaemonDisconnected: Failure.FailureFactory<
"DaemonDisconnected",
{ reason: "close" | "error" | "no-result"; }
>

The daemon accepted the run and then dropped the connection without a terminal message.

v
DaemonSilent: Failure.FailureFactory<"DaemonSilent", { ms: number; }>

The daemon accepted the connection and then said nothing for RUN_SILENCE_TIMEOUT_MS.

v
RUN_SILENCE_TIMEOUT_MS: 240000

How long the client waits on total silence before declaring the daemon wedged.