createTestCommand method
Implementation
CommandToRun createTestCommand({
required String projectRoot,
required DetermineFlutterOrDart tool,
required String relativeProjectRoot,
required List<String> flutterArgs,
required List<String> dartArgs,
required List<String> tests,
}) {
final toolArgs = tool.isFlutter ? flutterArgs : dartArgs;
final command = tool.tool();
final script = [
'$command test',
if (tests.isNotEmpty) tests.join(' '),
if (toolArgs.isNotEmpty) toolArgs.join(' '),
].join(' ');
logger.detail('Test command: $script');
var label = darkGray.wrap('Running (')!;
label += cyan.wrap(command)!;
label += darkGray.wrap(') tests in ')!;
label += yellow.wrap(relativeProjectRoot)!;
return CommandToRun(
command: script,
workingDirectory: projectRoot,
keys: ['dart', 'test', ...tests, ...toolArgs],
label: label,
);
}