swift-spyable
swift-spyable copied to clipboard
Swift macro that simplifies and automates the process of creating spies for testing
Thank you for creating this library 🤝 **Is your feature request related to a problem? Please describe.** Coucnrrency compliance is required in `Xcode 15.3` or later. Compliance with `Sendable` will...
Thank you for creating this library 🤝 **Describe the bug** Regarding `any`, which will definitely be implemented in swift in the future -> https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md We are unable to conduct tests...
**Is your feature request related to a problem? Please describe.** A spy is currently unable to be generated for `init` requirements. Any protocol with an `init` requirement will not synthesize...
Today, the following code ```swift @Spyable protocol ServiceProtocol { func foo() -> T } ``` will produce Spy that doesn't compile ```swift class ServiceProtocolSpy: ServiceProtocol { var fooCallsCount = 0...
- Allows protocols with *any* modifiers, like `public`, `fileprivate` etc. to inherit this access on the spy and all the generated members. This is done by taking the `modifiers` on...
Currently I'm super happy to use this macro, it allows me to drop third party dependency an the fact that mocks are generated in the main target allows me to...
**Is your feature request related to a problem? Please describe.** If you use the macro on a public protocol declaration from module A and you have a unit test in...
**Is your feature request related to a problem? Please describe.** Currently the generated spy doesn't handle generic functions:  **Describe the solution you'd like** In...
``` @Spyable internal protocol MyHapticsProtocol { func send(_ style: UIImpactFeedbackGenerator.FeedbackStyle) func send(_ type: UINotificationFeedbackGenerator.FeedbackType) } ``` results in a bunch `Invalid redeclaration of ...` warnings
**Is your feature request related to a problem? Please describe.** Given that it is currently not possible to generate a spy from a pre-existing protocol, it may be useful to...