Functions

f
buildErrorHTML(buildError: { type: string; formatted: string; }): string

Generates a self-contained HTML error page for a build failure, styled to match the QUnit HTML reporter (same element IDs, colors, and layout as qunit.css / qunitjs.com). Includes a WebSocket reconnect script that reloads the page on 'refresh' (next successful build). Uses location.port so no port needs to be baked in at generation time; the script is a no-op when the page is opened as a static file (location.port is empty).

f
buildNoTestsHTML(files: string[]): string

Generates a self-contained HTML warning page shown when a test run completes with 0 registered QUnit tests. Styled to match the QUnit HTML reporter, with an amber banner instead of red. Includes the same WebSocket reconnect script as buildErrorHTML so the page reloads on the next successful build.

f
registerGroupRoutes(
server: HTTPServer,
groupConfig: Config
): void

Registers HTML and JS bundle routes for one concurrent group on a shared HTTPServer. Routes: GET /group-${groupId}/ and GET /group-${groupId}/tests.js.

f
registerSharedStaticHandler(
server: HTTPServer,
groupConfigs: Config[]
): void

Registers a GET /* wildcard handler on a shared HTTPServer that serves static assets from each group's output directory, routing by /group-{id}/ URL prefix.

f
setup(config: Config): HTTPServer

Creates and returns an HTTPServer with routes for the test HTML, filtered test page, and static assets, plus a WebSocket handler that streams TAP events.

f
setupGroupWSHandler(
server: HTTPServer,
groupConfigs: Config[]
): void

Attaches the shared WebSocket event dispatcher to server.wss. Routes each socket's messages to the correct group's Config using the groupId baked into the browser-side wsOpen message by testRuntimeToInject.

f
testRuntimeSource(
config: Config,
groupId?: number
): string

The same runtime as bare JavaScript, for a page that injects it rather than serving it.

f
testRuntimeToInject(
config: Config,
groupId?: number
): string

The <script> that turns a page into a reporting test page: the QUnit preconfig, the WebSocket client, and the QUnit hooks that forward every event to this process.

Variables