flutterTest function

Stream<TestEvent> flutterTest(
  1. {Map<String, String>? environment,
  2. List<String>? arguments,
  3. List<String>? tests,
  4. String? workdingDirectory}
)

Executes flutter test and decode the output

Implementation

Stream<TestEvent> flutterTest({
  Map<String, String>? environment,
  List<String>? arguments,
  List<String>? tests,
  String? workdingDirectory,
  // TODO(rrousselGit) expose a typed interface for CLI parameters
}) {
  return _parseTestJsonOutput(
    () => Process.start(
      'flutter',
      [
        'test',
        ...?arguments,
        '--reporter=json',
        '--no-pub',
        ...?tests,
      ],
      environment: environment,
      workingDirectory: workdingDirectory,
    ),
  );
}