Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/Selective mocking #2

Conversation

sebastianbuechler
Copy link
Owner

This PR is a proposal for issue lomsa-com#136.

This package has two ways of mocking for Dio:

  • DioInterceptor
  • DioAdapter

It is my understanding that selective mocking only works for the first one as the latter one completely exchanges the HttpClientAdapter of Dio.

My proposed solution is to add a boolean failOnMissingMock, which is by default true for backwards compatibility. If set to false we do not throw an exception anymore when a mock is not matched, but instead send back a Future.value(null). This way we can detect the mismatch in the DioInterceptor and let Dio call the next interceptor.

Also, I added an option to print basic logs which are by default turned off.

@LukaGiorgadze what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant