createTestMiddleware function
Creates middleware for test purposes
Middleware is applied a Store
Implementation
SagaMiddleware createTestMiddleware([Options? options]) {
var testMiddleware = createSagaMiddleware(options);
var store = Store<dynamic>(
(dynamic state, dynamic action) {
return state;
},
initialState: 0,
middleware: [
applyMiddleware<dynamic>(testMiddleware),
],
);
testMiddleware.setStore(store);
return testMiddleware;
}