waitUntilAction method
Runs until the exact given action is dispatched, and then waits until it finishes. Returns the info after the action finishes. Ignores other actions.
Example use:
var action = MyAction(); storeTester.dispatch(action); await storeTester.waitUntilAction(action);
Implementation
Future<TestInfo<St>> waitUntilAction(
ReduxAction<St> action, {
int? timeoutInSeconds,
}) async {
timeoutInSeconds ??= defaultTimeout;
TestInfo<St>? testInfo;
while (testInfo == null || testInfo.action != action || testInfo.isINI) {
testInfo = await _next(timeoutInSeconds: timeoutInSeconds);
}
lastInfo = testInfo;
return testInfo;
}