saveForGlobalMethod method
Future<void>
saveForGlobalMethod({
- required FunctionElement methodElement,
- required FunctionDeclaration methodAstNode,
- required CompilationUnit compilationUnit,
- required ElementAnnotation annotation,
- required PubspecData pubspecData,
- required File methodFile,
- 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);
}