thenExpectInOrder method

Future<void> thenExpectInOrder(
  1. List<V> items
)

Implementation

Future<void> thenExpectInOrder(List<V> items) async {
  assert(_launch != null);
  await _waitForInitialModelIfNeeded();
  _launch?.call();

  // forEach is asynchronous in Dart, this is to force it to be synchronous
  for (final item in items) {
    completer = Completer<void>();
    await completer!.future.timeout(
      const Duration(seconds: 3),
      onTimeout: () => throw NeverReceivedUpdatedViewModelPipeTesterError(),
    );
    expect(receivedViewModel, item);
  }
}