Interface: TestEnvironmentOptions
Properties
activities?
optionalactivities?: readonlyActivityImplementation<never,unknown>[]
User-activity implementations (implementActivity, defineActivity, dynamicActivity).
activityInterceptors?
optionalactivityInterceptors?: readonlyActivityInboundInterceptor[]
Activity inbound interceptors around every user activity, first outermost.
connections?
optionalconnections?:Readonly<Record<string,Record<string,Json>>>
Connections ActivityContext.connection(name) returns.
enabled?
optionalenabled?:CommandGate
Command set the environment accepts: a feature set or a release level; default parity.
failOnUnfinishedHandlers?
optionalfailOnUnfinishedHandlers?:boolean
Turn the drain warning (a workflow that finishes while a signal handler
with policy WARN_AND_ABANDON still runs, 11 §2.18) into a failure of
result() (UnfinishedHandlersError). Default true.
historyRelease?
optionalhistoryRelease?:number
The runtime release whose history fields the environment writes (default
RUNTIME_RELEASE). Release 1 omits the R2 start fields that the
core service never wrote (lastCompletionResult on a
continue-as-new), so R1 conformance histories record unchanged.
interceptors?
optionalinterceptors?:WorkflowInterceptorsFactory|MarkedInterceptorsFactory
Workflow interceptors, as a bundle would export them as interceptors (in-process tasks only).
sinks?
optionalsinks?:Readonly<Record<string,Readonly<Record<string, (...args) =>void>>>>
Sink implementations called with each task's sink calls after the task completes.
startTime?
optionalstartTime?:string|number|Date
Start of the fake clock. Default 2026-01-01T00:00:00.000Z.
taskExecutor?
optionaltaskExecutor?: (request) =>WorkflowTaskResult|Promise<WorkflowTaskResult>
Run workflow tasks somewhere else than in this process, for example in
an isolate over a built bundle (runWorkflowTaskInVm, the QuickJS
runner). Start runs by export name then.
Parameters
request
Returns
WorkflowTaskResult | Promise<WorkflowTaskResult>
timeSkipping?
optionaltimeSkipping?:boolean
Advance the clock to the next timer whenever every run is idle (default true).
workflowKeys?
optionalworkflowKeys?:Readonly<Record<string,string>>
Workflow keys of tier-2 functions (key -> export name), for ctx.child('<key>') with a task executor.
workflows?
optionalworkflows?:Readonly<Record<string,DurableWorkflow<never,unknown>>>
Tier-2 functions by export name, for ctx.child(fn) and by-name starts.
workspaceId?
optionalworkspaceId?:string
Workspace id written into run info.