completion function Null safety

Matcher completion(
  1. dynamic matcher,
  2. [@Deprecated('this parameter is ignored') String? description]
)

Matches a Future that completes successfully with a value that matches matcher.

This creates an asynchronous expectation. The call to expect will return immediately and execution will continue. Later, when the future completes, the expectation against matcher will run. To wait for the future to complete and the expectation to run use expectLater and wait on the returned future.

To test that a Future completes with an exception, you can use throws and throwsA.

Implementation

Matcher completion(matcher,
        [@Deprecated('this parameter is ignored') String? description]) =>
    _Completes(wrapMatcher(matcher));