@hegeldev/hegel
    Preparing search index...

    Function run

    • Run a stateful test: apply randomly chosen rules of machine to state, checking its invariants along the way, as described in the module documentation. Call it inside a test body; the initial state is constructed there, so every test case starts afresh.

      Rules and invariants must be synchronous — one that returns a Promise fails the test with a TypeError. Use runAsync (inside testAsync) for asynchronous machines.

      Throws an Error if machine has no rules or options.stepCount is below 1.

      Type Parameters

      • S

      Parameters

      Returns void

      hegel.test((tc) => {
      hegel.stateful.run(tc, stackMachine, { items: [] }, { stepCount: 200 });
      });