addUnitTestOverrides function

void addUnitTestOverrides(
  1. String pathToProject
)

Implementation

void addUnitTestOverrides(String pathToProject) {
  /// we are running in a unit test so
  /// we need to add pubspec overrides so that the
  /// newly created project will from the dev source
  /// for dcli and dcli_core rather than looking to pub.dev.
  final pathToDCli = DartProject.self.pathToProjectRoot;
  final pathToDCliCore = join(pathToDCli, '..', 'dcli_core');

  join(pathToProject, 'pubspec_overrides.yaml').write('''
  dependency_overrides:
    dcli:
  path: $pathToDCli
    dcli_core:
  path: $pathToDCliCore

  ''');
}