Skip to content
This repository was archived by the owner on Mar 14, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/graphql_generator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ void main() {
// ///Read the generated result from the file as String.
var result = await resultFile.readAsString();

// ///Compare both the results.
expect(expectedResult, result);
DiffMatchPatch dmp = new DiffMatchPatch();
List<Diff> differences = dmp.diff(expectedResult, result);
print(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be asserting something? Also ideally we check the actual diff contents.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@venkatd Yes, we can check if the response is equal to the local file. But since we are comparing the local file to a remote response the output will fail for a small change in the GraphQL response. I added only the diff to simplify the output shown.

"No. of differences ${differences.where((x) => x.operation != DIFF_EQUAL).length}");
});

tearDown(() async {
Expand Down