TestRunCommand constructor

TestRunCommand({
  1. required PubspecYaml pubspecYaml,
  2. required Bindings bindings,
  3. required PubspecLock pubspecLock,
  4. required FindFile findFile,
  5. required FileSystem fs,
  6. required Logger logger,
})

Implementation

TestRunCommand({
  required this.pubspecYaml,
  required this.bindings,
  required this.pubspecLock,
  required this.findFile,
  required this.fs,
  required this.logger,
}) : argParser = ArgParser(usageLineLength: 120) {
  addTestFlags(this);

  argParser.addSeparator(cyan.wrap('SIP Flags:')!);
  argParser
    ..addFlag(
      'recursive',
      abbr: 'r',
      help: 'Run tests in subdirectories',
      negatable: false,
    )
    ..addFlag(
      'concurrent',
      abbr: 'c',
      aliases: ['parallel'],
      help: 'Run tests concurrently',
      negatable: false,
    )
    ..addFlag(
      'bail',
      abbr: 'b',
      help: 'Bail after first test failure',
      negatable: false,
    )
    ..addFlag(
      'clean',
      help: 'Whether to remove the optimized test files after running tests',
      defaultsTo: true,
    )
    ..addFlag(
      'dart-only',
      help: 'Run only dart tests',
      negatable: false,
    )
    ..addFlag(
      'flutter-only',
      help: 'Run only flutter tests',
      negatable: false,
    )
    ..addFlag(
      'optimize',
      help: 'Whether to create optimized test files',
      defaultsTo: true,
    );
}