interface RunRequest

Client → daemon: request to execute a test run with the given argv/env in the daemon's persistent Chrome.

const request: RunRequest = {
  type: 'run', argv: ['test/foo-test.ts', '--failFast'],
  cwd: '/proj', env: { CI: undefined }, nodeVersion: 'v24.14.0',
};
JSON.stringify(request) + '\n'; // one NDJSON line, ready for the socket

Properties

type: "run"

Discriminator for the protocol union; always 'run' for this variant.

argv: string[]

CLI arguments after qunitx (i.e. process.argv.slice(2)).

Resolved options, when the request came from the JS API rather than a command line. Present means "build the config from these and answer with a result chunk"; absent means the daemon parses argv exactly as the CLI would.

Only what survives JSON is here — no plugin objects, no reporter instances, no callbacks. DaemonRunOptions is the type that enforces that at the call site rather than discovering it at the socket.

cwd: string

Client's working directory. The daemon rejects mismatched cwds (different project).

env: Record<string, string | undefined>

Client's full process environment, applied to the run and restored on completion.

Client's process.version. The daemon shuts down on mismatch to avoid module-graph drift.

Usage

import { type RunRequest } from "lib/commands/daemon/protocol.ts";