decision control
Guides

Test cases

Save simulations as cases, gate the publish on them.

A decision can carry test cases: an input and what the answer must be (status, decision, a subset of outputs, actions that must be requested, or an expected errorCode).

Only what a case states is checked, so adding an output does not break every case written before it.

Save a simulation as a case

In the simulator, after a run that looks right, choose Save as case. The current input and the output you saw (with status, decision, the actions it requested) become a case the publish must keep reproducing.

Mocks

Cases can:

  • Fix the clock (mocks.now) so a case that depends on $now is reproducible.
  • Answer outbound calls from canned responses (mocks.http) so the case runs without the network and unmatched calls fail instead of reaching the outside world.

Gates the publish

Every enabled case runs before a publish, against exactly what is about to be published (pinned tables and sub-decisions, frozen constants). A single failure refuses the publish with 422 TESTS_FAILED and the full report. The report of a successful publish is stored on the version.

Test runs persist nothing and enqueue no action. Restoring an old version skips the cases on purpose — a rollback must not be blocked by cases written for the newer logic — and the audit log records that they were skipped.

On this page