Skip to content

Commit

Permalink
chore: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danthorpe committed Dec 8, 2024
1 parent d83ebee commit 9939094
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Tests/OAuthTests/OAuthDelegateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ final class OAuthDelegateTests: OAuthTestCase {
.server(authenticationMethod: .stub)
.authenticated(oauth: stub)

// Configure Network
try await network.stubOAuthSystem {
await $0.set(presentationContext: DefaultPresentationContext())
}

// Make a request to protected resource
var request = HTTPRequestData(path: "/protected-resource")
request.authenticationMethod = .stub
Expand Down
2 changes: 1 addition & 1 deletion Tests/OAuthTests/StubOAuthSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct StubOAuthSystem: StandardOAuthSystem {

extension NetworkingComponent {
func stubOAuthSystem<ReturnValue>(
perform: (any OAuthProxy<StubOAuthSystem.Credentials>) async throws -> ReturnValue
perform: @MainActor (any OAuthProxy<StubOAuthSystem.Credentials>) async throws -> ReturnValue
) async throws -> ReturnValue {
try await oauth(of: StubOAuthSystem.Credentials.self, perform: perform)
}
Expand Down

0 comments on commit 9939094

Please sign in to comment.