vigiles API reference
    Preparing search index...

    Function propertyHook

    • Property-test a hook's decision over generated events. Throws nothing — returns a result you assert on (assert.ok(r.passed)), so the counterexample is inspectable. mutate(event, rng) produces a variation from the running event; each named invariant is checked against decide(event).

      Type Parameters

      • E
      • D

      Parameters

      • opts: {
            decide: (event: E) => D;
            invariants: Record<string, (decision: D, event: E) => boolean>;
            iterations?: number;
            mutate: (event: E, rng: number) => E;
            seed: E;
        }

      Returns HookPropertyResult<E>