diff --git a/Tests/OpenFeatureTests/DeveloperExperienceTests.swift b/Tests/OpenFeatureTests/DeveloperExperienceTests.swift index f8699bb..53fa65f 100644 --- a/Tests/OpenFeatureTests/DeveloperExperienceTests.swift +++ b/Tests/OpenFeatureTests/DeveloperExperienceTests.swift @@ -70,7 +70,7 @@ final class DeveloperExperienceTests: XCTestCase { let provider = InjectableEventHandlerProvider(eventHandler: eventHandler) Task { await OpenFeatureAPI.shared.setProviderAndWait(provider: provider) - wait(for: [readyExpectation], timeout: 1) + await fulfillment(of: [readyExpectation], timeout: 1) initCompleteExpectation.fulfill() } wait(for: [notReadyExpectation], timeout: 1) @@ -81,7 +81,7 @@ final class DeveloperExperienceTests: XCTestCase { let brokenProvider = AlwaysBrokenProvider() Task { await OpenFeatureAPI.shared.setProviderAndWait(provider: brokenProvider) - wait(for: [errorExpectation], timeout: 2) + await fulfillment(of: [errorExpectation], timeout: 2) errorProviderExpectation.fulfill() } diff --git a/Tests/OpenFeatureTests/FlagEvaluationTests.swift b/Tests/OpenFeatureTests/FlagEvaluationTests.swift index 9d366e0..80d5003 100644 --- a/Tests/OpenFeatureTests/FlagEvaluationTests.swift +++ b/Tests/OpenFeatureTests/FlagEvaluationTests.swift @@ -126,7 +126,7 @@ final class FlagEvaluationTests: XCTestCase { } OpenFeatureAPI.shared.setProvider(provider: provider) - wait(for: [readyExpectation], timeout: 5) + await fulfillment(of: [readyExpectation], timeout: 5) let client = OpenFeatureAPI.shared.getClient() let key = "key" let booleanDetails = FlagEvaluationDetails( @@ -189,7 +189,7 @@ final class FlagEvaluationTests: XCTestCase { } OpenFeatureAPI.shared.setProvider(provider: provider) - wait(for: [readyExpectation], timeout: 5) + await fulfillment(of: [readyExpectation], timeout: 5) let client = OpenFeatureAPI.shared.getClient() @@ -268,6 +268,7 @@ final class FlagEvaluationTests: XCTestCase { XCTAssertEqual(details.errorCode, .providerFatal) XCTAssertEqual(details.reason, Reason.error.rawValue) XCTAssertEqual(details.errorMessage, "A fatal error occurred in the provider: Always broken") + XCTAssertNotNil(eventState) } func testClientMetadata() {