describeAsync<T> function

Future<Iterable<String>> describeAsync<T>(
  1. AsyncCondition<T> condition
)

Creates a description of the expectations checked by condition.

The strings are individual lines of a description. The description of an expectation may be one or more adjacent lines.

Matches the "Expected: " lines in the output of a failure message if a value did not meet the last expectation in condition, without the first labeled line.

In contrast to describe, asynchronous expectations are allowed in condition.

Implementation

Future<Iterable<String>> describeAsync<T>(AsyncCondition<T> condition) async {
  final context = _TestContext<T>._root(
    value: _Absent(),
    fail: (_) {
      throw UnimplementedError();
    },
    allowAsync: true,
    allowUnawaited: true,
  );
  await condition(Subject._(context));
  return context.detail(context).expected.skip(1);
}