Skip to main content

testing

npm i @temporalio/testing

Testing library for the SDK.

Documentation

Classes​

Interfaces​

Type Aliases​

ClientOptionsForTestEnv​

ClientOptionsForTestEnv = Omit<ClientOptions, "namespace" | "connection">

Subset of the "normal" client options that are used to create a client for the test environment.


EphemeralServerExecutable​

EphemeralServerExecutable = { downloadDir?: string; ttl?: Duration; type: "cached-download"; version?: string; } | { path: string; type: "existing-path"; }

Which version of the executable to run.

Union Members​

Type Literal​

{ downloadDir?: string; ttl?: Duration; type: "cached-download"; version?: string; }

downloadDir?​

optional downloadDir?: string

Download destination directory or the system's temp directory if none set.

ttl?​

optional ttl?: Duration

How long to cache the download for. Default to 1 day.

type​

type: "cached-download"

version?​

optional version?: string

Optional version, can be set to a specific server release or "default" or "latest".

At the time of writing the the server is released as part of the Java SDK - (https://github.com/temporalio/sdk-java/releases).

Default​
"default" - get the best version for the current SDK version.

Type Literal​

{ path: string; type: "existing-path"; }

path​

path: string

Path to executable

type​

type: "existing-path"


ExistingServerConnectionOptions​

ExistingServerConnectionOptions = Pick<NativeConnectionOptions, "apiKey" | "metadata" | "tls">


ExistingServerTestWorkflowEnvironmentOptions​

ExistingServerTestWorkflowEnvironmentOptions = object

Options for TestWorkflowEnvironment.createFromExistingServer

Accepts connection options that can be used for both the client and worker connections.

Properties​

address?​

optional address?: string

If not set, defaults to localhost:7233

client?​

optional client?: ClientOptionsForTestEnv

connectionOptions?​

optional connectionOptions?: ExistingServerConnectionOptions

namespace?​

optional namespace?: string

If not set, defaults to default

plugins?​

optional plugins?: (ClientPlugin | ConnectionPlugin | NativeConnectionPlugin)[]


LocalTestWorkflowEnvironmentOptions​

LocalTestWorkflowEnvironmentOptions = object

Options for TestWorkflowEnvironment.createLocal

Properties​

client?​

optional client?: ClientOptionsForTestEnv

plugins?​

optional plugins?: (ClientPlugin | ConnectionPlugin | NativeConnectionPlugin)[]

server?​

optional server?: Omit<DevServerConfig, "type">


NexusEndpointIdentifier​

NexusEndpointIdentifier = object

Properties​

id​

id: NonNullable<IEndpoint["id"]>

raw​

raw: IEndpoint

version​

version: NonNullable<IEndpoint["version"]>


TimeSkippingTestWorkflowEnvironmentOptions​

TimeSkippingTestWorkflowEnvironmentOptions = object

Options for TestWorkflowEnvironment.createTimeSkipping

Properties​

client?​

optional client?: ClientOptionsForTestEnv

plugins?​

optional plugins?: (ClientPlugin | ConnectionPlugin | NativeConnectionPlugin)[]

server?​

optional server?: Omit<TimeSkippingServerConfig, "type">

Variables​

workflowInterceptorModules​

const workflowInterceptorModules: string[]

Convenience workflow interceptors

Contains a single interceptor for transforming AssertionErrors into non retryable ApplicationFailures.