diff --git a/Tests/ApiVideoPlayerTests/IntegrationTests/AVPlayerExtensionsTests.swift b/Tests/ApiVideoPlayerTests/IntegrationTests/AVPlayerExtensionsTests.swift index ff70514e..fe670643 100644 --- a/Tests/ApiVideoPlayerTests/IntegrationTests/AVPlayerExtensionsTests.swift +++ b/Tests/ApiVideoPlayerTests/IntegrationTests/AVPlayerExtensionsTests.swift @@ -7,14 +7,14 @@ import XCTest final class AVPlayerExtensions: XCTestCase { func testValidHLSVideoIdPlay() throws { let observer = AVPlayerReadyObserverImpl(testCase: self) - _ = observer.readyExpectation + let ready = observer.readyExpectation let avPlayer = AVPlayer(playerItem: nil) avPlayer.replaceCurrentItem(withHls: VideoOptions(videoId: VideoId.validVideoId, videoType: .vod)) avPlayer.currentItem?.addObserver(observer, forKeyPath: "status", options: .new, context: nil) avPlayer.play() - waitForExpectations(timeout: 10, handler: nil) + wait(for: [ready], timeout: 10) avPlayer.currentItem?.removeObserver(observer, forKeyPath: "status") }