TestWatchCommand constructor
TestWatchCommand({
- required Bindings bindings,
- required FindFile findFile,
- required FileSystem fs,
- required Logger logger,
- required PubspecLock pubspecLock,
- required PubspecYaml pubspecYaml,
- 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,
);
}