-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
silence expectations related swift warning
- Loading branch information
1 parent
b9479fa
commit a979479
Showing
1 changed file
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,7 @@ | |
} catch { | ||
XCTAssertEqual((error as NSError).code, AuthErrorCode.missingPhoneNumber.rawValue) | ||
} | ||
await waitForExpectations(timeout: 5) | ||
await fulfillment(of: [expectation], timeout: 5.0) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pragatimodi
Author
Contributor
|
||
} | ||
|
||
/** @fn testVerifyInvalidPhoneNumber | ||
|
@@ -553,15 +553,15 @@ | |
forwardingNotification: forwardingNotification) | ||
let auth = try XCTUnwrap(PhoneAuthProviderTests.auth) | ||
let provider = PhoneAuthProvider.provider(auth: auth) | ||
let expectation = self.expectation(description: function) | ||
var expectations = [expectation(description: function)] | ||
|
||
if !reCAPTCHAfallback { | ||
// Fake out appCredentialManager flow. | ||
auth.appCredentialManager?.credential = AuthAppCredential(receipt: kTestReceipt, | ||
secret: kTestSecret) | ||
} else { | ||
// 1. Intercept, handle, and test the projectConfiguration RPC calls. | ||
let projectConfigExpectation = self.expectation(description: "projectConfiguration") | ||
let projectConfigExpectation = expectation(description: "projectConfiguration") | ||
rpcIssuer?.projectConfigRequester = { request in | ||
XCTAssertEqual(request.apiKey, PhoneAuthProviderTests.kFakeAPIKey) | ||
projectConfigExpectation.fulfill() | ||
|
@@ -591,7 +591,8 @@ | |
) | ||
} | ||
if errorURLString == nil, presenterError == nil { | ||
let requestExpectation = self.expectation(description: "verifyRequester") | ||
let requestExpectation = expectation(description: "verifyRequester") | ||
expectations.append(requestExpectation) | ||
rpcIssuer?.verifyRequester = { request in | ||
XCTAssertEqual(request.phoneNumber, self.kTestPhoneNumber) | ||
switch request.codeIdentity { | ||
|
@@ -632,11 +633,11 @@ | |
} catch { | ||
// If an error occurs, assert that verificationID is nil and the error code matches the | ||
// expected value | ||
XCTAssertEqual((error as? NSError)?.code, errorCode) | ||
XCTAssertEqual((error as NSError).code, errorCode) | ||
} | ||
expectation.fulfill() | ||
expectations[0].fulfill() | ||
// Make sure the test waits for expectations to be fulfilled | ||
await waitForExpectations(timeout: 5.0) | ||
await fulfillment(of: expectations, timeout: 5.0) | ||
} | ||
|
||
private func initApp(_ functionName: String, | ||
|
Why is there an expectation in this test?