Last active
July 2, 2022 17:55
-
-
Save danahartweg/d2141b6cf79168cd8641b2b72ae6343d to your computer and use it in GitHub Desktop.
Client test harness - Unit testing Flutter GraphQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MockGraphQLClient generateMockGraphQLClient() { | |
final graphQLClient = MockGraphQLClient(); | |
final queryManager = MockQueryManager(); | |
when(() => graphQLClient.defaultPolicies).thenReturn(DefaultPolicies()); | |
when(() => graphQLClient.queryManager).thenReturn(queryManager); | |
return graphQLClient; | |
} | |
class MockGraphQLClient extends Mock implements GraphQLClient {} | |
class MockQueryManager extends Mock implements QueryManager {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment