done method

Future<TuiResult> done({
  1. Duration timeout = const Duration(seconds: 2),
})

Waits for the run to end on its own (for example an OutcomeModel with an outcome), and returns the result. Throws TuiTestFailure when timeout passes first; rethrows an error the run ended with.

Implementation

Future<TuiResult> done({
  Duration timeout = const Duration(seconds: 2),
}) async {
  final value = await _run.timeout(timeout, onTimeout: () {
    throw TuiTestFailure('the program did not end within '
        '${timeout.inMilliseconds} ms.\n${_frame(screen)}');
  });
  return TuiResult._(model, screen, styledScreen, value);
}