The machine to run the assertion on.
The expected route as an arrow-delimited string:
"idle -> pending -> success -> done"
Optionaloptions: TAssertRouteOptionsimport { Statebot } from 'statebot'
import { assertRoute } from 'statebot/assert'
let machine = Statebot(...)
assertRoute(
machine, 'prepare -> debounce -> sending -> done -> idle',
{
description: 'Email sent with no issues',
fromState: 'idle',
timeoutInMs: 1000 * 20,
permittedDeviations: 0,
logLevel: 3
}
)
.then(() => console.log('Assertion passed!'))
.catch(err => console.error(`Whoops: ${err}`))
machine.enter('idle')
Assert that a index.TStatebotFsm traced the route specified.
Whereas routeIsPossible only checks that a particular route can be followed,
assertRoutewill hook-into a machine and wait for it to trace the specified path within a timeout period.