Test actions
Actions can be tested by calling NgStateTestBed.createActions
method. createActions
has required param actions
and two params with default values: initialState
with value {}
and statePath
with value []
. This means that for most of situations we can pass just actions type and test application in localized state. But for more complex scenarios we can pass initial state and path.
where
first param is
initialState
is object or classsecond param is
statePath
to bind actions tothird param is
actions
class
createActions
as well ascreateSignalActions
takes into consideration injectable actions. Dependenices are mocked and injected according to Angular TestBed.
Last updated