Skip to content

Commit 021aa25

Browse files
committed
chore(): Updated iOS fetchAuthSession unit test to support Result
1 parent 962a76b commit 021aa25

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/amplify_datastore/example/ios/unit_tests/NativeAuthPluginTests.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,14 @@ class NativeAuthPluginTests: XCTestCase {
5151
let binaryMessenger = MockBinaryMessenger(isSignedIn: isSignedIn)
5252
let nativePlugin = NativeAuthPlugin(binaryMessenger: binaryMessenger)
5353
let expectation = expectation(description: "fetchAuthSession completes")
54-
nativePlugin.fetchAuthSession { session in
55-
defer { expectation.fulfill() }
56-
XCTAssertNotNil(session)
57-
XCTAssertEqual(session.isSignedIn, isSignedIn)
54+
nativePlugin.fetchAuthSession { result in
55+
switch result {
56+
case .success(let session):
57+
defer { expectation.fulfill() }
58+
assertSession(session, isSignedIn)
59+
case .failure(let error):
60+
XCTFail("fetchAuthSession failed with error: \(error)")
61+
}
5862
}
5963
waitForExpectations(timeout: 1)
6064
}

0 commit comments

Comments
 (0)