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
We have an autogenerated Network Stack. Cuckoo cannot mock protocol extensions that have functions with default parameters.
protocolApolloNetworkService{varapolloClient:ApolloClient{get}func allClashesFeedQueryWatch(cachePolicy:CachePolicy)->AnyPublisher<AllClashesFeedQueryModel,Error>}extensionApolloNetworkService{func allClashesFeedQueryWatch( cachePolicy:CachePolicy=.returnCacheDataAndFetch )->AnyPublisher<AllClashesFeedQueryModel,Error>{// this function cannot be mocked. }}func test(){letmockNetwork=MockApolloNetworkService()stub(networkService){ stub inwhen(allClashesFeedQueryWatch(cachePolicy:any())).thenReturn(Empty().eraseToAnyPublisher())}// This calls actual implementation
mockNetwork.allClashesFeedQueryWatch()// this returns mock
mockNetwork.allClashesFeedQueryWatch(cachePolicy:.fromCache)}
The text was updated successfully, but these errors were encountered:
We have an autogenerated Network Stack. Cuckoo cannot mock protocol extensions that have functions with default parameters.
The text was updated successfully, but these errors were encountered: