waitUntilAny method

Future<TestInfo<St>> waitUntilAny(
  1. List<Type> actionTypes, {
  2. int? timeoutInSeconds,
})

Runs until an action of the given types is dispatched, and then waits until it finishes. Returns the info after the action finishes. Ignores other actions types.

Implementation

Future<TestInfo<St>> waitUntilAny(
  List<Type> actionTypes, {
  int? timeoutInSeconds,
}) async {
  timeoutInSeconds ??= defaultTimeout;

  TestInfo<St>? testInfo;

  while ((testInfo == null) || (!actionTypes.contains(testInfo.type)) || testInfo.isINI) {
    testInfo = await _next(timeoutInSeconds: timeoutInSeconds);
  }

  lastInfo = testInfo;

  return testInfo;
}