Arms V8 line coverage on the page before navigation, returning whether it started.
resetOnNavigation: false keeps the data across the goto below, so the bundle's execution
is captured. Chromium-only — run.ts already disables coverage for firefox/webkit, and
page.coverage exists only on chromium pages.
Builds all concurrent group bundles with a single esbuild invocation.
Pre-builds the esbuild bundle for all test files and caches the result in the group's build state.
Cache key for the daemon/watch incremental esbuild context. Single source of truth
for what makes two builds interchangeable: file set + every BuildOption that varies
between runs. Items intentionally NOT keyed: plugins (daemon shuts down on
package.json mtime change; the prepended qunitxRuntimePlugin is static and
deterministic), nodePaths (cwd-bound, daemon stays in cwd), and the
hardcoded literals (bundle, keepNames, legalComments, jsx, sourcemap,
footer, logLevel). When adding a new variable BuildOption, extend this function
— that is the contract enforced by the unit suite.
Classifies a finished browser run.
Derives a human-readable error category from an esbuild BuildFailure or a generic Error. Inspects the first structured esbuild message when available; falls back to string heuristics.
Awaits all in-flight console handler promises until the Set is stably empty, recursing to catch handlers added by Firefox BiDi events that arrive during each await. The deadline (default 2 s) guards against infinite recursion.
Formats esbuild BuildFailure messages into clean human-readable text (no ANSI codes). When given a structured BuildFailure, each error is formatted with its file location and a caret line. Falls back to stripping ANSI codes from the error's string representation.
Reconciles the Node-side counter with QUnit's authoritative in-page tally after a run finishes, for a single-group run. Returns how many finished results the WebSocket stream failed to deliver (0 on a clean run).
Runs the esbuild-bundled tests inside a Playwright-controlled browser page and streams TAP output.
| { kind: "empty"; }
| { kind: "no-tests-ran"; }
| { kind: "stalled"; }
How a browser run ended, decided from QUnit's tally plus whether a WS done arrived.
Usage
import * as mod from "lib/commands/test/tests-in-browser.ts";