Flogs
Flogs copied to clipboard
Error in unit test - MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)
I'm unit testing a service that relies on FLog.
My service's method contains a logging statement, FLog.info(text: 'message');
that results in the following error:
MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)
When I change the logging call to FLog.trace(text: 'message');
, it works fine...guessing because it doesn't actually try and write a log entry.
Is there a way around this? Can I mock the FLog method calls? Or, do I need to create my own logging interface that calls FLog internally, and, then mock that interface in my unit tests?
Solution from @asidt could help you: https://github.com/flutter/flutter/issues/10912#issuecomment-587403632
@slc1973 The solution in your link used to work. But since 2.10.5 I keep getting this error, described in this issue. Any other solutions?