waitUntil method

Future<TestInfo<St>> waitUntil(
  1. Type actionType, {
  2. int timeoutInSeconds = defaultTimeout,
})

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

Implementation

Future<TestInfo<St>> waitUntil(
  Type actionType, {
  int timeoutInSeconds = defaultTimeout,
}) async {
  TestInfo<St>? testInfo;

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

  lastInfo = testInfo;

  return testInfo;
}