2.6.0
New features
-
Support elseif/else directive by @fummicc1 in #328
#if DEBUG import Foundation #elseif FEATURE_X import FeatureX #else import Production #endif /// @mockable protocol PresentableListener: AnyObject { func run() #if DEBUG func showDebugMode() #elseif FEATURE_X func showFeatureXMode() #else func showReleaseMode() #endif }
-
Unify handler injection way between class-based and actor-based mocks. by @fummicc1 in #334
/// @mockable protocol Foo: Actor { func baz(arg: String) async -> Int } actor FooMock: Foo { ... // `nonisolated` is added! nonisolated var bazHandler: ((String) async -> Int)? { get { bazState.withLock(\.handler) } set { bazState.withLock { $0.handler = newValue } } }
-
Add subscript setter support with handler and call count by @farkasseb in #337
/// @mockable public protocol SendableSubscriptProtocol: Sendable { subscript(key: Int) -> String { get set } } public final class SendableSubscriptProtocolMock: SendableSubscriptProtocol, @unchecked Sendable { ... public var subscriptHandler: (@Sendable (Int) -> String)? { get { subscriptState.withLock(\.handler) } set { subscriptState.withLock { $0.handler = newValue } } } ... // `SetHandler` is new! public var subscriptSetHandler: (@Sendable (Int, String) -> ())? { get { subscriptSetState.withLock(\.handler) } set { subscriptSetState.withLock { $0.handler = newValue } } }
Fix bugs
- Fix incorrect handling of MetatypeType (T.Type) by @sidepelican in #333
- Fix Name Override With Inheritance by @plx in #338
Maintenances
- Overhaul of
SwiftTypeby @sidepelican in #317 - Generate setHandler method for actor based test-double by @fummicc1 in #322
- Refactor: Remove unnecessary Foundation imports by @Roshankumar350 in #323
- The mutability of Swift structs is controlled by the use site. by @Roshankumar350 in #329
- Update swift-syntax to 602.0.0 by @farkasseb in #332
- Upgrade GitHub Actions for Node 24 compatibility by @salmanmkc in #335
- Update version to 2.6.0 by @sidepelican in #339
New Contributors
- @Roshankumar350 made their first contribution in #323
- @farkasseb made their first contribution in #332
- @salmanmkc made their first contribution in #335
- @plx made their first contribution in #338
Full Changelog: 2.5.0...2.6.0
For Build Tools Plugin (artifactbundle)
.binaryTarget(
name: "mockolo",
url: "https://github.com/uber/mockolo/releases/download/2.6.0/mockolo.artifactbundle.zip",
checksum: "47bf9befcb1a92ba801d13018c8e1f110e3bb9fd6b19e4983d53a3a0ad986780"
),