waitUntil method

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

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,
}) async {
  timeoutInSeconds ??= defaultTimeout;

  TestInfo<St>? testInfo;

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

  lastInfo = testInfo;

  return testInfo;
}