Skip to content

Commit

Permalink
fix: update unit tests (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrarafer authored Jul 18, 2023
1 parent 6f8c3b6 commit 8bdef92
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/services/file_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,29 @@ void main() {
filePath: ksTestFileName, removedContent: content);
List<String> file = await File(ksTestFileName).readAsLines();
expect(
file.contains(recasedContent.snakeCase) ||
file.contains('${recasedContent.pascalCase}View'),
file.contains('/${recasedContent.snakeCase}') ||
file.contains(' ${recasedContent.pascalCase}'),
false);
});

test(
'when called with filepath & content with type service lines holding content should be removed from the file',
() async {
createTestFile(kAppMobileTemplateTestHelpersContent);
String content = "navigation";
var recasedContent = ReCase(content);
final content = "navigation";
final recasedContent = ReCase(content);
final fileService = _getService();
await fileService.removeSpecificFileLines(
filePath: ksTestFileName,
removedContent: content,
type: kTemplateNameService,
);
String file = await File(ksTestFileName).readAsString();
final file = await File(ksTestFileName).readAsString();
print('--- file ---');
print(file);
expect(
file.contains(recasedContent.snakeCase) ||
file.contains('${recasedContent.pascalCase}Service'),
file.contains('/${recasedContent.snakeCase}') ||
file.contains(' ${recasedContent.pascalCase}'),
false);
});
});
Expand Down

0 comments on commit 8bdef92

Please sign in to comment.