aion/testing/mock

Typed activity mock registry for aion/testing.

Tests register mocks against an Activity(i, o) value so the handler is statically checked against the same input and output types that workflow.run will use. The test-only FFI double stores a type-erased wrapper in process-scoped state and intercepts activity dispatch by name.

Values

pub fn activity(
  env: env,
  activity_value: activity.Activity(input, output),
  handler: fn(input) -> Result(output, error.ActivityError),
) -> Result(env, error.EngineError)

Register a typed activity mock for the current process.

A handler whose input or output type does not match the supplied activity will fail at gleam build, before the workflow test can run.

Search Document