Skip to content

ProjectWorker

Private app resources for one worker: server overrides, environment, browser-visible fixtures, execution preparation, drain and cleanup. Share immutable build output; isolate mutable databases, queues, files and sessions.

Property Modifier Type Description
beforeExecution? readonly (context: ProjectExecution) => void | ExecutionPreparation | PromiseLike<void | ExecutionPreparation> Prepare one assignment before browser hooks start. Return optional JSON fixtures and a fixture transport binding. Keys must not replace static fixture keys. Preparation consumes this test’s timeout and runs once across assignment reply replays. Callbacks must honor cancellation; Dyno joins actual settlement before resource destruction, so uncooperative Node work can delay shutdown. Interrupted or failed preparation requires restarting Dyno. Only the app owns database reset and independent jobs.
drain? readonly (context: ProjectExecution) => void | PromiseLike<void> Wait for work this execution started after document retirement between tests. The final successful document can remain for inspection; close app admission and join its backend work anyway. Honor cancellation. Failed draining ends the run and saves accepted results; teardown must remain safe afterward.
env? readonly Readonly<Record<string, string>> Environment values added to this worker’s app process.
fixtures? readonly Readonly<Record<string, unknown>> JSON-safe IDs, paths and other values supplied to browser tests.
teardown? readonly () => void | PromiseLike<void> Release resources acquired by this worker. Setup teardown runs once after all workers close.
webServer? readonly Partial<{ command?: string | readonly string[]; cwd?: string; env?: Readonly<Record<string, string>>; ready?: string | RegExp; reuseExistingServer?: boolean; timeout?: number; url: string; }> Override the app command, URL or readiness settings for this worker.