Declarative tests for hierarchical state machines: expectations map, ordered trace of action/invoke labels. Invoke :src is not run; each id uses :invoke-returns if present, else {}. Returns :ok or failure maps for RCF.
Declarative tests for hierarchical state machines: expectations map, ordered trace
of action/invoke labels. Invoke :src is not run; each id uses :invoke-returns if present,
else {}. Returns :ok or failure maps for RCF.(fn->keyword f event-name)Best-effort label for a function: named defn/closure parent name, else :on-<event>.
When f is a Var (e.g. #'foo/bar used in machine :src/:actions so reloads
pick up redefinitions), reads the name from var metadata.
JVM: only segments after the first $ are function names (first segment is namespace).
Best-effort label for a function: named defn/closure parent name, else :on-<event>. When `f` is a Var (e.g. `#'foo/bar` used in machine `:src`/`:actions` so reloads pick up redefinitions), reads the name from var metadata. JVM: only segments after the first `$` are function names (first segment is namespace).
(run-single-transition machine from-path event-name expected opts)Runs one transition with tracing. Returns {:from :event :expected-target :actual-target :expected-trace :actual-trace :pass? ...}
Runs one transition with tracing. Returns
{:from :event :expected-target :actual-target
:expected-trace :actual-trace :pass? ...}(test-machine expectations machine & [opts])Expectations: {from-state {event expected-result ...} ...} expected-result: keyword/vector (target only) or {:target ... :trace [...] :ctx ... :event-params ...}. opts may include :state-key (default :_state), :ctx merged into the transition context, and :invoke-returns {invoke-id value | ex-info} for mocked invokes (unlisted ids get {}). Returns :ok or a vector of failure maps.
Expectations: {from-state {event expected-result ...} ...}
expected-result: keyword/vector (target only) or {:target ... :trace [...] :ctx ... :event-params ...}.
opts may include :state-key (default :_state), :ctx merged into the transition context,
and :invoke-returns {invoke-id value | ex-info} for mocked invokes (unlisted ids get {}).
Returns :ok or a vector of failure maps.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |