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).
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.
Registers HTML and JS bundle routes for one concurrent group on a shared HTTPServer.
Routes: GET /group-${groupId}/ and GET /group-${groupId}/tests.js.
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.
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.
The same runtime as bare JavaScript, for a page that injects it rather than serving it.
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.
Usage
import * as mod from "lib/setup/web-server.ts";