Skip to main content

Module testing

Module testing 

Source
Expand description

One function call outside a run, for a host’s unit tests.

call runs one call of one function through the path a run takes:

  • the config compiles as it would in a workflow: the function is registered, its config compiled under a Prepare naming it, and the checks a workflow’s compile runs walk the config’s expressions;
  • the call gets a real Ctx and overlay over the message given, and the layers given run around it, as a run’s layers do;
  • it settles as a run settles a call: an Ok, whatever its Outcome, applies the call’s writes to the message, an Err drops them and their Changes, and the records the call added are kept either way.

No recorder runs, so the message gains no audit entry, no metadata.progress and no record of the call’s own Err: the Called says what the call returned. No registry, compiler, definition or engine is assembled by hand. config compiles a config alone, and config_with compiles one with the host’s own ExprEngine.

Structs§

Call
One call of a function, waiting to be awaited: what call returns.
Called
What one call did.

Enums§

Write
One write a call made, at the path it named: what testing::Called::writes lists, in the order the call made them.

Functions§

call
One call of f, with its config compiled from input as a workflow would compile it; .await runs it.
config
A config compiled alone, against ExprEngine::default, with nothing prepared or checked beyond the config’s own compile. Err carries every issue, at its path below the input.
config_with
A config compiled alone, as config compiles it, against exprs: the host’s engine, with its own operators and secrets.