Open AhmedMohamedAllam opened 1 year ago
Disclaimer: I'm not a maintainer of this project. But IMO having default return values is a bad idea. The only scenario where the default is used is if the tested code interacts with the mocks in a way the test did not foresee. In that case, how much value is the test adding? If the test did not foresee that a mock is used in a certain way, how can that same test still prove that the tested code works correctly? The (default) return value is usually used for something, something which is probably not covered by the test if a default would be ok for you.
I have a NetworkProtocol, that have
request()
method there are some test cases, where the flow can call the network, but I dinidn't provide aGiven
call in this test. is there a way to fallback to a default value if no mocks found? and also it doesn't point to where the mocked data are missing it fails only without any further information.