TestWatchCommand constructor

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

Implementation

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

  argParser
    ..addSeparator(cyan.wrap('SIP Flags:')!)
    ..addFlag(
      'recursive',
      abbr: 'r',
      help: 'Run tests in subdirectories',
      negatable: false,
    )
    ..addFlag(
      'concurrent',
      abbr: 'c',
      aliases: ['parallel'],
      help: 'Run tests concurrently',
      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,
    )
    ..addOption(
      'scope',
      help: 'The scope of tests to run',
      defaultsTo: TestScope.active.option,
      allowed: TestScope.values.map((e) => e.option).toList(),
      allowedHelp: {
        for (final val in TestScope.values) val.option: val.help,
      },
    )
    ..addFlag(
      'optimize',
      help: 'Whether to create optimized test files (Dart only)',
      defaultsTo: true,
    );
}