Closed Myzel394 closed 1 year ago
Okay seems like this project is dead basically. Anyway, if you still want to use it, here's how I fixed it:
testWidgets
instead of test
Example:
testWidgets("my test", (tester) async {
tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(
const MethodChannel("flutter_logs"),
(call) async {
if (call.method == "logThis") {
print(
"{${call.arguments['tag']}} {${call.arguments['subTag']}} {${call.arguments['logMessage']}} {${DateTime.now().toIso8601String()} {${call.arguments['level']}}",
);
}
return "";
},
);
});
Is there some way to use this with unit tests / mock the functions?