waitAllUnorderedGetLast method

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

Runs until all given actions types are dispatched, in any order. Waits until all of them are finished. Returns the info after all actions finish. Will fail with an exception if an unexpected action is seen.

If you pass action types to ignore, they will be ignored (the test won't fail when encountering them, and won't collect testInfo for them). This method will remember all ignored actions and wait for them to finish, so that they don't "leak" to the next wait. An action type cannot exist in both actionTypes and ignore lists.

Implementation

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

  return (await waitAllUnordered(
    actionTypes,
    timeoutInSeconds: timeoutInSeconds,
    ignore: ignore,
  ))
      .last;
}