interface ScriptOutcome

What one execution of the script produced.

Properties

entry: string

Absolute path of the file that ran, resolved against cwd.

value: unknown

The script's export default, or undefined when it has none — or when it had one that could not be handed back, in which case ScriptOutcome.valueProblem says so.

valueProblem: string | null

Why ScriptOutcome.value is undefined despite the script exporting something, or null when there is nothing to explain.

Never fatal. The script ran; only the souvenir did not fit through the door, and a script whose default export is a main() function is a perfectly ordinary script.

exitCode: number

globalThis.exitCode if the script set one, 1 if it threw, else 0.

The suite the entry declared, or null when it was a plain script.

A file that registers QUnit tests is a suite, whichever verb pointed at it, and reporting it as an empty script run would be reporting success for tests that never ran. Non-null here means TAP was produced and ScriptOutcome.exitCode is the suite's.

The script's own console calls and uncaught errors, in emit order and capped at MAX_BROWSER_LOGS — the same shape and the same cap a test run reports, because it is the same thing: a page's console, read over CDP.

How many were dropped to stay under the cap. 0 when nothing was.

Usage

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