saveForGlobalMethod method

Future<void> saveForGlobalMethod({
  1. required FunctionElement methodElement,
  2. required FunctionDeclaration methodAstNode,
  3. required CompilationUnit compilationUnit,
  4. required ElementAnnotation annotation,
  5. required PubspecData pubspecData,
  6. required File methodFile,
  7. required TestRunInfo testRunInfo,
})

Implementation

Future<void> saveForGlobalMethod(
    {required FunctionElement methodElement,
    required FunctionDeclaration methodAstNode,
    required CompilationUnit compilationUnit,
    required ElementAnnotation annotation,
    required PubspecData pubspecData,
    required File methodFile,
    required TestRunInfo testRunInfo}) async {
  final List<String> excludedMethods = annotation.excludeMethods;
  final fileImport =
      'package:${pubspecData.packageName}/${PathUtils.relatetiveLibFilePath(methodFile.path)}';
  await _saveTestsForMethod(
      method: MapEntry(methodElement.displayName, methodAstNode),
      compilationUnit: compilationUnit,
      fileImport: fileImport,
      excludedMethods: excludedMethods,
      subjectFile: methodFile,
      testRunInfo: testRunInfo);
}