testing
npm i @temporalio/testing
Testing library for the SDK.
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?
optionaldownloadDir?:string
Download destination directory or the system's temp directory if none set.
ttl?
optionalttl?:Duration
How long to cache the download for. Default to 1 day.
type
type:
"cached-download"
version?
optionalversion?: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?
optionaladdress?:string
If not set, defaults to localhost:7233
client?
optionalclient?:ClientOptionsForTestEnv
connectionOptions?
optionalconnectionOptions?:ExistingServerConnectionOptions
namespace?
optionalnamespace?:string
If not set, defaults to default
plugins?
optionalplugins?: (ClientPlugin|ConnectionPlugin|NativeConnectionPlugin)[]
LocalTestWorkflowEnvironmentOptions
LocalTestWorkflowEnvironmentOptions =
object
Options for TestWorkflowEnvironment.createLocal
Properties
client?
optionalclient?:ClientOptionsForTestEnv
plugins?
optionalplugins?: (ClientPlugin|ConnectionPlugin|NativeConnectionPlugin)[]
server?
optionalserver?: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?
optionalclient?:ClientOptionsForTestEnv
plugins?
optionalplugins?: (ClientPlugin|ConnectionPlugin|NativeConnectionPlugin)[]
server?
optionalserver?:Omit<TimeSkippingServerConfig,"type">
Variables
workflowInterceptorModules
constworkflowInterceptorModules:string[]
Convenience workflow interceptors
Contains a single interceptor for transforming AssertionErrors into non
retryable ApplicationFailures.