writeWaitingMessage method

void writeWaitingMessage(
  1. TestScope scope, {
  2. required bool runConcurrently,
})

Implementation

void writeWaitingMessage(TestScope scope, {required bool runConcurrently}) {
  var testScope = darkGray.wrap('Test Scope: ')!;
  testScope += magenta.wrap(scope.option)!;
  testScope += darkGray.wrap(' (${scope.help})')!;

  testScope += darkGray.wrap(
    '\n  Press `t` to cycle ${TestScope.values.map((e) => e.option)}',
  )!;
  testScope = darkGray.wrap(testScope)!;

  var concurrent = darkGray.wrap('Concurrency: ')!;

  if (runConcurrently) {
    concurrent += green.wrap('ON')!;
  } else {
    concurrent += darkGray.wrap('OFF')!;
  }
  concurrent += darkGray.wrap('\n  Press `c` to toggle concurrency')!;

  final waitingMessage = '''

${yellow.wrap('Waiting for changes...')}
$testScope
$concurrent
${darkGray.wrap('Press `r` to run tests again')}
${darkGray.wrap('Press `q` to exit')}
''';

  logger.write(waitingMessage);
}