loadApprovedCasesIfExists static method

List loadApprovedCasesIfExists({
  1. String? filePath,
})

Loads approved test cases from a Dart file.

Implementation

static List<dynamic> loadApprovedCasesIfExists({String? filePath}) {
  late File file = File(filePath ?? _defaultPath);
  if (file.existsSync()) {
    String content = file.readAsStringSync();
    return jsonDecode(content);
  }
  return [];
}