MakeAWishFoundation/SwiftyMocky

There is no fallback data, if no 'Given` method provided.

Opened this issue · 1 comments

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 a Given 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.

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.