waitAllGetLast method

Future<TestInfo<St>> waitAllGetLast(
  1. List<Type> actionTypes,
  2. {List<Type>? ignore}
)

Runs until all given actions types are dispatched, in 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, or if any of the expected actions are dispatched in the wrong order.

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). However, if an action type exists both in actionTypes and ignore, it will be expected in that particular order, and the others of that type will be ignored. This method will remember all ignored actions and wait for them to finish, so that they don't "leak" to the next wait.

If ignore is null, it will use the global ignore provided in the StoreTester constructor, if any. If ignore is an empty list, it will disable that global ignore.

Implementation

Future<TestInfo<St>> waitAllGetLast(
  List<Type> actionTypes, {
  List<Type>? ignore,
}) async {
  assert(actionTypes.isNotEmpty);
  ignore ??= _ignore;

  var infoList = await waitAll(actionTypes, ignore: ignore);

  lastInfo = infoList.last;

  return infoList.last;
}