interface ScriptSettings

Everything a caller may set on a script run: the CLI's flags and the API's options, minus argv.

Properties

optional
cwd: string

Directory the entry, relative imports and node_modules lookups resolve against.

optional
projectRoot: string

Skips the package.json walk when the caller has already done it.

optional
browser: "chromium" | "firefox" | "webkit"

Engine the script runs in. Defaults to chromium.

optional
port: number

Port the local server binds. Defaults to 1234.

optional
portExplicit: boolean

True when a port was named explicitly, which makes a taken one an error rather than a search.

optional
watch: boolean

Re-run on every save instead of exiting after one run.

optional
open: boolean

Run in a visible browser window.

optional
timeout: number | null

Ms the script may run before it is declared hung; null (the default) is unbounded.

optional
reporter: Args.ParsedFlags["reporter"]

Stdout format when the entry turns out to be a suite. Ignored by a plain script, which has no report to format — its own output IS the output.

optional
junit: Args.ParsedFlags["junit"]

Writes a JUnit XML report for a declared suite. Ignored by a plain script.

optional
debug: Args.ParsedFlags["debug"]

Prints the server URL and the page's console, as the bare verb's --debug does.

optional
filter: Args.ParsedFlags["filter"]

Narrows a declared suite to matching tests. Ignored by a plain script.

optional
console: Console

Where the script's own output goes, as test() and watch() take one. Defaults to this process's stdout and stderr; pass silentConsole to capture it from the result instead.

Usage

import { type ScriptSettings } from "lib/commands/run.ts";