Package-level declarations
Types
Intercepts the render pass of the root workflow and runs it twice to ensure that well-written unit tests catch side effects being incorrectly performed directly in the render method.
The props must be specified, the initial state may be specified, and then all child workflows and workers that are expected to run, and any outputs from them, must be specified with expectWorkflow and (optionally) expectWorker and expectSideEffect calls. If one needs to verify all workers explicitly, perhaps to verify that a worker is not run, then use requireExplicitWorkerExpectations. Likewise requireExplicitSideEffectExpectations for side effects. Then call render and perform any assertions on the rendering. An event may also be sent to the rendering if no workflows or workers emitted an output. Lastly, the RenderTestResult returned by render
may be used to assert on the WorkflowActions processed to handle events or outputs by calling verifyAction or verifyActionResult.
Result of a RenderTester.render call that can be used to verify that a WorkflowAction was processed and perform assertions on that action.
Implementation of Worker for integration tests (using launchForTestingFromStartWith or launchForTestingFromStateWith) that need to simply push values into the worker from the test.
Defines configuration for workflow testing infrastructure such as testRender
, testFromStart
. and test
.
Runs a Workflow and provides access to its renderings, outputs, and snapshots.
Simple wrapper around a ReceiveTurbine of RenderingT to provide convenience helper methods specific to Workflow renderings.
Functions
Specifies that this render pass is expected to run a particular side effect.
Specifies that this render pass is expected to run a Worker that has the same type of the given worker and for which the actual worker's doesSameWorkAs
method returns true. If a worker is ran that matches the type of expected, but the actual worker's doesSameWorkAs
returns false, then an AssertionError will be thrown. If you need to perform custom assertions, use the overload of this method that takes an assertWhen
parameter.
Specifies that this render pass is expected to run a Worker with the given workerClass. The worker's output type is not taken into consideration.
Specifies that this render pass is expected to run a Worker whose KType matches workerType.
Specifies that this render pass is expected to run a Worker with the given outputType.
Specifies that this render pass is expected to render a particular child workflow.
Version of headlessIntegrationTest that does not require props. For Workflows that have Unit props type.
This is a test harness to run integration tests for a Workflow tree. The parameters passed here are the same as those to start a Workflow runtime with renderWorkflowIn except for ignoring state persistence as that is not needed for this style of test.
Creates a WorkflowTestRuntime to run this workflow for unit testing.
Creates a WorkflowTestRuntime to run this workflow for unit testing. If the workflow is stateful, initialState is not called. Instead, the workflow is started from the given initialState.
Creates a WorkflowTestRuntime to run this workflow for unit testing.
Create a RenderTester to unit test an individual render pass of this workflow, using the workflow's initial state.
Create a RenderTester to unit test an individual render pass of this SessionWorkflow, using the workflow's initial state, in the workflowScope.
Create a RenderTester to unit test an individual render pass of this workflow.