TestModel <TSnapshot, TEvent, TInput>
Index
Constructors
Properties
Methods
Constructors
constructor
Type parameters
- TSnapshot: Snapshot<unknown>
- TEvent: EventObject
- TInput
Parameters
logic: ActorLogic<TSnapshot, TEvent, TInput, AnyActorSystem>
optionaloptions: Partial<TestModelOptions<TSnapshot, TEvent>>
Returns TestModel<TSnapshot, TEvent, TInput>
Properties
publicoptionaldefaultTraversalOptions
publiclogic
publicoptions
Methods
publicgetAdjacencyList
An array of adjacencies, which are objects that represent each
state
with thenextState
given theevent
.Returns { event: TEvent; nextState: TSnapshot; state: TSnapshot }[]
publicgetAllStates
Returns TSnapshot[]
publicgetDefaultOptions
Returns TestModelOptions<TSnapshot, TEvent>
publicgetPaths
Parameters
pathGenerator: PathGenerator<TSnapshot, TEvent, TInput>
optionaloptions: Partial<TraversalOptions<TSnapshot, TEvent>>
Returns TestPath<TSnapshot, TEvent>[]
publicgetPathsFromEvents
Parameters
events: TEvent[]
optionaloptions: TraversalOptions<TSnapshot, TEvent>
Returns TestPath<TSnapshot, TEvent>[]
publicgetShortestPaths
Parameters
optionaloptions: Partial<TraversalOptions<TSnapshot, TEvent>>
Returns TestPath<TSnapshot, TEvent>[]
publicgetShortestPathsFrom
Parameters
paths: TestPath<TSnapshot, TEvent>[]
optionaloptions: Partial<TraversalOptions<TSnapshot, any>>
Returns TestPath<TSnapshot, TEvent>[]
publicgetSimplePaths
Parameters
optionaloptions: Partial<TraversalOptions<TSnapshot, TEvent>>
Returns TestPath<TSnapshot, TEvent>[]
publicgetSimplePathsFrom
Parameters
paths: TestPath<TSnapshot, TEvent>[]
optionaloptions: Partial<TraversalOptions<TSnapshot, any>>
Returns TestPath<TSnapshot, TEvent>[]
publicresolveOptions
Parameters
optionaloptions: Partial<TestModelOptions<TSnapshot, TEvent>>
Returns TestModelOptions<TSnapshot, TEvent>
publictestPath
Parameters
path: StatePath<TSnapshot, TEvent>
params: TestParam<TSnapshot, TEvent>
optionaloptions: Partial<TestModelOptions<TSnapshot, TEvent>>
Returns Promise<TestPathResult>
publictestPathSync
Parameters
path: StatePath<TSnapshot, TEvent>
params: TestParam<TSnapshot, TEvent>
optionaloptions: Partial<TestModelOptions<TSnapshot, TEvent>>
Returns TestPathResult
publictestState
Parameters
params: TestParam<TSnapshot, TEvent>
state: TSnapshot
optionaloptions: Partial<TestModelOptions<TSnapshot, TEvent>>
Returns Promise<void>
publictestStateSync
Parameters
params: TestParam<TSnapshot, TEvent>
state: TSnapshot
optionaloptions: Partial<TestModelOptions<TSnapshot, TEvent>>
Returns void
Creates a test model that represents an abstract model of a system under test (SUT).
The test model is used to generate test paths, which are used to verify that states in the model are reachable in the SUT.