ALL BUSINESS
COMIDA
DIRECTORIES
EDUCATIONAL
ENTERTAINMENT
FASHION TIPS
FINER THINGS
FREE CREATOR TOOLS
HEALTH
MARKETPLACE
MEMBER's ONLY
MONEY MATTER$
MOTIVATIONAL
NEWS & WEATHER
TECHNOLOGIA
TELEVISION NETWORKS
USA VOTES 2024
VIDEOS
INVESTOR RELATIONS
IN DEVELOPMENT
Posted by - Latinos MediaSyndication -
on - August 15, 2023 -
Filed in - Technology -
-
478 Views - 0 Comments - 0 Likes - 0 Reviews
Xcode Cloud fails to run some of my tests. Looks like it does not recognize the fulfillment(of:timeout:enforceOrder:) method.
The error I am getting is:
Cannot find 'fulfillment' in scope
The triggering code is very simple and when run locally, all is green. I changed the names of the variables but it looks like this:
func testThatFooThrows() async throws { // GIVEN let expectation = expectation(description: "Expect to throw error") let fooMock = FooMock<Bar>() fooMock.failWithBadUrlError() let sut = FooService(contentID: "Test", myService: fooMock) // WHEN do { _ = try await sut.doSomething() } catch { expectation.fulfill() } // THEN await fulfillment(of: [expectation], timeout: 0.1) }
Everything seems to work when I change the failing line to:
wait(for: [expectation], timeout: 0.1)
Instance method 'wait' is unavailable from asynchronous contexts; Use await fulfillment(of:timeout:enforceOrder:) instead; this is an error in Swift 6
However, as the warning says, this is not the best.
The documentation says that the fulfillment(of:timeout:enforceOrder:) method is available starting with Xcode 11. My Xcode Cloud setup uses Xcode 14.3.1 (14E300c) and macos Ventura 13.5 (22G74)
How can I make Xcode Cloud "see" the fulfillment(of:timeout:enforceOrder:) method?