Skip to content

Commit

Permalink
Fix async wrapper and return void
Browse files Browse the repository at this point in the history
  • Loading branch information
okhan-okbay-cko committed Feb 5, 2024
1 parent 0439704 commit 15195bf
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 15195bf

Please sign in to comment.