interface BuildState
extends EsbuildCache

One group's esbuild output and in-flight build bookkeeping, kept warm between watch-mode rebuilds. Lives at state.group.build, so it shares the group's lifetime rather than being threaded alongside the config as a second, independently-passable bag.

const build: BuildState = { allTestCode: null, htmlPathsToRunTests: [], lastBuildErrored: false };
build.allTestCode; // null — nothing compiled yet, the first build fills it

Properties

allTestCode: Buffer | string | null

Full test bundle source, or null before the first build completes.

optional
filteredTestCode: Buffer | string

Bundle filtered to files that failed on the previous run (used by re-run mode).

Absolute paths of every HTML file that will be opened in the browser to run tests.

optional
preBuildPromise: Promise<void> | null

In-flight build promise started by run.ts before Chrome setup completes (initial run) or before run is called (reruns), so esbuild races navigation. Consumed and cleared by the first run() call.

optional
activeRebuild: Promise<void> | null

Set when a parallel rebuild is in-flight during a watch-mode rerun. The /tests.js route awaits this before serving, so Chrome can navigate concurrently while esbuild finishes. Cleared by run after the build settles.

optional
fallbackPage: FallbackPage | null

Replaces the normal test page for this run, or null when the run renders tests as usual. The web server's / route serves this page and the Playwright page is navigated there. Cleared at the start of every new build attempt.

true if the most recent build ended in an esbuild error. Keeps state.watch.lastBuildEndMs pinned to the last good build so a fix arriving after the error is never suppressed. Written by every run, read only in watch mode.