expectLater function

Future expectLater(
  1. dynamic actual,
  2. dynamic matcher,
  3. {String? reason,
  4. Object? skip}

Just like expect, but returns a Future that completes when the matcher has finished matching.

For the completes and completion matchers, as well as throwsA and related matchers when they're matched against a Future, the returned future completes when the matched future completes. For the prints matcher, it completes when the future returned by the callback completes. Otherwise, it completes immediately.

If the matcher fails asynchronously, that failure is piped to the returned future where it can be handled by user code.


Future expectLater(dynamic actual, dynamic matcher,
        {String? reason, Object? /* String|bool */ skip}) =>
    _expect(actual, matcher, reason: reason, skip: skip);