Liking cljdoc? Tell your friends :D

taia.ds.state-machines.test-helpers

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.
raw docstring

fn->keywordclj

(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).
sourceraw docstring

run-single-transitionclj

(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? ...}
sourceraw docstring

test-machineclj

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close