You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In large projects, it is often cumbersome to have to stub APIs over and over again, especially if you only want to verify when they were called.
Describe the solution you'd like
It would be nice to be able to register default responses for certain return types, either per mock, or (even more useful), globally.
Right now, null is returned from every stub by default. It would be nice to be able to do something like
Describe alternatives you've considered
Right now, methods that return void don't need to actively be stubbed, since null is returned by default. It is a bit inconsistent that the same doesn't apply to Future<void> Function(...), this Feature would allow for setting this up in a flutter_test_config.dart file for example.
Since the _defaultResponses mechanism is private, this can't really be implemented in another package like package:mocktailx
Is your feature request related to a problem? Please describe.
In large projects, it is often cumbersome to have to stub APIs over and over again, especially if you only want to
verify
when they were called.Describe the solution you'd like
It would be nice to be able to register default responses for certain return types, either per mock, or (even more useful), globally.
Right now,
null
is returned from every stub by default. It would be nice to be able to do something likeDescribe alternatives you've considered
Right now, methods that return
void
don't need to actively be stubbed, sincenull
is returned by default. It is a bit inconsistent that the same doesn't apply toFuture<void> Function(...)
, this Feature would allow for setting this up in aflutter_test_config.dart
file for example.Since the
_defaultResponses
mechanism is private, this can't really be implemented in another package likepackage:mocktailx
Additional context
The text was updated successfully, but these errors were encountered: