mockolo icon indicating copy to clipboard operation
mockolo copied to clipboard

Efficient Mock Generator for Swift

Results 37 mockolo issues
Sort by recently updated
recently updated
newest added

## What did you do? Created a mock for a protocol with an async function, e.g. ``` /// @mockable protocol APIClient { func fetchData(_ id: AnyObject) async -> Int }...

### Environment macOS 13.4.1 Swift version 5.8.1 Xcode 14.3.1 v2.0.1 ### Issue The following code produces a mock that does not compile successfully ### Protocols to Mock ``` // ModuleA...

I want to create a mock from a protocol that inherits from `Sendable` with this OSS, but I have a problem. Mocks generated by this OSS have variables, so if...

Fix of the opened issue https://github.com/uber/mockolo/issues/250

## What did you do? Run `mockolo -s -d ` on the source folder which doesn't have protocols with `mockable` annotation. It generated a file without any mocks. ## What...

I wonder if there's a specific reason that `@objc` protocols are not supported? ```swift /// @mockable(history: performRequest = true) @objc public protocol SCCrashLoggerNetworkExecuting: NSObjectProtocol { @objc func performRequest( request: URLRequest,...

After swift 5.6 it's possible to declare in protocols async and/or throws properties: ``` /// @mockable protocol AsyncProperties { var isAvailable: Bool { get async throws } } ``` but...

ref: https://github.com/apple/swift-evolution/blob/main/proposals/0303-swiftpm-extensible-build-tools.md

Generating a mock of a class with the following properties will result in a compile-time error in the callCount section. var isOpen:Bool { return true } Error:. Cannot observe read-only...

# Issue Part of #216 (https://github.com/uber/mockolo/issues/216#issuecomment-1454179318 's "1.") # Description Add an annotation "object: class/actor" for specifying the object nominal types of the mock. This allows the user to choose,...