The result of a run that was cancelled before it began: no browser, no tests, aborted: true.
Assembles the run's result from the config's accumulated state, the run's outcome, and the APIReporter that watched it.
Runs the suite once in a real browser and resolves with everything it produced.
The run's line coverage: one entry per source file, plus the totals across all of them.
-
coverableLines: number
Coverable lines across every file.
-
coveredLines: number
Covered lines across every file.
-
files: FileCoverageSummary[]
One entry per non-test source file the bundle mapped back to.
-
percent: number
Overall percentage covered.
Per-file line coverage, when coverage was requested.
-
coverableLines: number
Lines the source map attributes to executable positions in the bundle.
-
coveredLines: number
Lines executed at least once.
-
path: string
Path relative to the project root, with forward slashes.
-
percent: number
coveredLines / coverableLines, as a percentage rounded to two decimals.
What the run actually resolved to, after package.json, the defaults and the options were
merged — the answers a caller cannot otherwise recover from what it passed in.
-
browser: "chromium" | "firefox" | "webkit"
The engine the tests ran in.
-
coverageFormats: string[]
Coverage artifact formats beyond the terminal summary.
-
extensions: string[]
File extensions treated as test files.
-
filter: string
The active test-name filter, when one was set.
-
output: string
Absolute path of the build output directory — where the bundle and artifacts landed.
-
port: number
The port actually bound, which may differ from the one requested.
-
projectRoot: string
Absolute path of the directory holding
package.json.
One concurrent group of a run: the files bundled into a single page, and where that page's artifacts were written.
-
files: string[]
Absolute paths of the test files this group bundled and ran together.
-
index: number
Position in the run's group list, and the
group-<index>suffix onoutput. -
output: string
Absolute path of this group's build output directory.
Everything a finished run produced.
-
browserLogs: BrowserLog[]
console.*calls and uncaught errors from the page — warnings and errors unlessdebug. -
browserLogsDropped: number
How many page-log entries were dropped to stay under the cap.
0in every ordinary run. -
counts: RunCounts
Outcome totals.
-
coverage: CoverageSummary | null
Line coverage, or
nullwhencoveragewas not requested. -
durationMs: number
Wall-clock duration of the test phase, in milliseconds.
-
exitCode: number
What the CLI would have exited with:
0whenok,1otherwise. -
failedFiles: string[]
Absolute paths of the test files with at least one failure, attributed via source maps.
-
failures: TestResult[]
The subset of
teststhat failed — the list you almost always want first. -
files: string[]
Absolute paths of the test files this run executed — the ones scoped to, in a filtered watch rerun, rather than everything being watched.
-
finishedAt: number
Epoch ms when it ended.
-
groups: RunGroup[]
How the files were split across concurrent groups — one entry per group, never empty.
groups.lengthis the concurrency the run actually used;1for watch and single-file runs. -
junitXml: string | null
The JUnit XML document, when
junitwas requested. Written to disk as well. -
notices: Notice[]
qunitx's own diagnostics for this run, in emission order.
-
ok: boolean
truewhen every test passed and nothing else went wrong. -
resolved: ResolvedRun
What the run resolved to — see ResolvedRun.
-
startedAt: number
Epoch ms when the test phase began.
-
status: "completed" | "aborted" | "failFast"
How the run finished: whether it got through everything it selected, and if not, what stopped it. Distinct from RunResult.ok, which is the verdict — a
completedrun can be entirely red, and anabortedone can have no failures at all. -
tests: TestResult[]
Every finished test, in the order the browser reported them.
One finished test.
-
assertions: TestAssertion[]
The test's assertions. QUnit trims these for passing tests, so this is populated for failures and empty otherwise — a passing test's assertion count is not reported.
-
durationMs: number
How long the test took, in milliseconds.
-
file: string | null
Source file this test was declared in, relative to the project root, or
null. -
fullName: string
"Module > Sub: test name"— the stringfiltermatches against. -
modules: string[]
The QUnit module path it was declared under; empty for a top-level test.
-
name: string
The test's own name, without its modules.
-
status: "passed" | "failed" | "skipped" | "todo"
QUnit's outcome for this test.
Outcome totals for a run. total is the sum of the four buckets; assertionsFailed counts
individual assertions rather than tests, so one test can contribute several.
Every way a run can fail to happen: an option the runner will not accept, an unreadable input,
a directory with no package.json above it, an esbuild plugin that will not load.
Usage
import * as mod from "lib/api/test.ts";