Function routeIsPossible

  • routeIsPossible(machine: TStatebotFsm, route: string | string[]): boolean
  • Assert that a certain route can be followed by a TStatebotFsm.

    This merely tests that a certain path can be taken through a state-machine. It doesn't assert that the states are moved-through while the machine is working, as with assertRoute.

    Returns

    Example

    import { Statebot } from 'statebot'
    import { routeIsPossible } from 'statebot/assert'

    let machine = Statebot(...)

    routeIsPossible(machine,
    'walking -> falling -> splatting -> walking'
    )
    // false

    Parameters

    • machine: TStatebotFsm

      The machine to test the route on.

    • route: string | string[]

      The route to test as an arrow-delimited string:

      "idle -> pending -> success -> done"

    Returns boolean

Generated using TypeDoc