Skip to content

Commit

Permalink
Merge pull request #14 from checkout/fix/async-wrapper-mock
Browse files Browse the repository at this point in the history
Fix async wrapper and return void
  • Loading branch information
okhan-okbay-cko authored Feb 6, 2024
2 parents 0439704 + 15195bf commit b7aa490
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ final public class CheckoutNetworkFakeClient: CheckoutClientInterface {
extension CheckoutNetworkFakeClient {
public func runRequest<T: Decodable>(with configuration: CheckoutNetwork.RequestConfiguration) async throws -> T {
calledAsyncRequests.append(configuration)
// swiftlint:disable force_cast
return dataToBeReturned as! T
// swiftlint:enable force_cast
}

public func runRequest(with configuration: RequestConfiguration) async throws {
calledAsyncRequests.append(configuration)
try await Task.sleep(nanoseconds: 1 * 1_000_000_000) // 1 second
return ()
}
}

0 comments on commit b7aa490

Please sign in to comment.