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
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.
The text was updated successfully, but these errors were encountered:
AhmedMohamedAllam
changed the title
There is no fallback data, if given didn't find the method mocked.
There is no fallback data, if no 'Given` method provided.
Aug 8, 2023
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()
methodthere 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.
The text was updated successfully, but these errors were encountered: