-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to agree on a mocking framework to use for tests #326
Comments
@goktugyil what's your plan on that? |
The main caveat of a traditional mocking framework is that swift is not support reflection for writes - http://blog.pragmaticengineer.com/swift-the-only-modern-language-with-no-mocking-framework/. We might have to resort to compile time code generation - https://github.com/SwiftKit/Cuckoo. I am not sure if that is the right approach. As a degenerate case we might have to just write fakes manually. |
I believe the best way to approach this problem would be to write a prototype with a chosen framework (declare it before hand in this issue) and submit a pull request. If consensus is achieved we can declare that as our framework of choice. I will pick https://github.com/SwiftKit/Cuckoo for testing. |
I agree with Khalian. Test a couple frameworks separately, merge the best one to master and continue using that. |
My status for this right now:- Podfile : target 'EZSwiftExtensions-iOS' do I was able to get the Cuckoo sources down. However this seems extremely counterproductive (requiring the pod sources will add non trivial amounts of time to travis build). Is there a maven equivalent to the IOS dev ecosystem? Maven just downloads the repos in a directory and defines the JVM classpath to point from that. Given travis's VM based build architecture, the cache wont keep getting wiped across builds. I must say as of now I am pretty disappointed with the way the IOS ecosystem has argued about devops and build practices. |
I have almost zero knowledge in devops for iOS, so I don't think I can help much |
@pixel4 any help? |
I'm not a fan of I know the question was more regarding the issue with having to download the pod source every time, so answering the right question: That's how My going back to Out of curiosity, why do we need UI Test mocking for |
@pixel4 The sole reason is to increase unit test coverage for most of the UIKit extensions. |
@pixel4 Whats your take on increasing test coverage on APIs where mocking is necessary (e.g UIDeviceExtensions). I dont like code gen mockups either, but I dont see a way out short of creating my own stubs/spys. |
Exactly.. that's the only way out. On the projects I work on I usually have a system in place with protocols to allow stubbing but to be honest I mostly use on network related code. |
Ok I will write something and send out a PR. Let the collaborators take a look at the writing custom shims approach. |
Certain tests (e. G ui device extensions) require a mocking framework. We need to decide on one.
The text was updated successfully, but these errors were encountered: