PackageToTest constructor

PackageToTest({
  1. required DetermineFlutterOrDart tool,
  2. required String packagePath,
  3. String? optimizedPath,
})

Implementation

PackageToTest({
  required this.tool,
  required String packagePath,
  this.optimizedPath,
}) {
  this.packagePath = switch (packagePath) {
    _ when packagePath.contains('${p.separator}test') =>
      packagePath.split('${p.separator}test').first,
    _ when packagePath.contains('${p.separator}lib') =>
      packagePath.split('${p.separator}lib').first,
    _ => packagePath,
  };
}