throwOnMissingStub function
Opt-into Mock throwing NoSuchMethodError for unimplemented methods.
The default behavior when not using this is to always return null
.
Implementation
void throwOnMissingStub(
Mock mock, {
void Function(Invocation)? exceptionBuilder,
}) {
exceptionBuilder ??= mock._noSuchMethod;
mock._defaultResponse =
() => CallPair<dynamic>.allInvocations(exceptionBuilder!);
}