Skip to content

Conversation

@alexanderjordanbaker
Copy link
Collaborator

No description provided.

}

// Test helper method to set request override
internal func setExecuteRequestOverride(_ override: @escaping @Sendable (HTTPClientRequest, Data?) async throws -> HTTPClientResponse) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use typealias to improve readability?


// requestBody passed for testing purposes
internal func executeRequest(_ urlRequest: HTTPClientRequest, _ requestBody: Data?) async throws -> HTTPClientResponse {
if let override = executeRequestOverride {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use guard let to improve readability?

guard let  executeRequestOverride else {
    return try await self.client.execute(urlRequest, timeout: .seconds(30))
}
return try await executeRequestOverride(urlRequest, requestBody)

typealias RequestVerifier = (HTTPClientRequest, Data?) throws -> ()

typealias RequestVerifier = @Sendable (HTTPClientRequest, Data?) throws -> ()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good example to use typealias here!

import NIOFoundationCompat
import JWTKit

final class AppStoreServerAPIClientTests: XCTestCase {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you consider migrating this into SwiftTesting to improve CI performance?

Copy link

@aluco100 aluco100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants