-
I'm not sure what response I need to provide to make these go away, as I can't debug my tests with all of the noise. I'm currently giving it a |
Beta Was this translation helpful? Give feedback.
Answered by
lishaduck
Jan 5, 2025
Replies: 1 comment
-
This worked: (Fuller code)
class MockDioAdapter extends Mock implements HttpClientAdapter {}
HttpClientAdapter _getMockAdapter() {
final mockDioAdapter = MockDioAdapter();
// ignore: discarded_futures - Must not be async for Mocktail to work.
when(() => mockDioAdapter.fetch(any(), any(), any())).thenAnswer(
(_) => Future.value(
ResponseBody(Stream.value(TileProvider.transparentImage), 200),
),
);
return mockDioAdapter;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lishaduck
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This worked:
ResponseBody(Stream.value(TileProvider.transparentImage), 200)
.(Fuller code)