Skip to content

Commit

Permalink
Merge pull request #25 from nomasystems/fix/24-tests-compilation-erro…
Browse files Browse the repository at this point in the history
…r-and-race

fix: tests compilation error and race

Resolves #24
  • Loading branch information
bobergj authored Sep 4, 2023
2 parents 66d45ca + cbdd7a6 commit 64d8905
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Tests/NMAImageFetchTests/NMAImageFetchTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import NMAImageFetch
import NMAImageFetchSwift
import UIKit

@available(iOS 13, *)
final class NMAImageFetchTests: XCTestCase {

override func setUp() async throws {
Expand All @@ -24,6 +25,7 @@ final class NMAImageFetchTests: XCTestCase {
XCTFail()
}
}
wait(for: [expectationWithoutCaching], timeout: 5)
let expectationWithCaching = expectation(description: "Image request finished width caching")
_ = imageFetch.requestImage(imageFetchRequest) { result in
expectationWithCaching.fulfill()
Expand All @@ -34,7 +36,7 @@ final class NMAImageFetchTests: XCTestCase {
XCTFail()
}
}
waitForExpectations(timeout: 5)
wait(for: [expectationWithCaching], timeout: 5)
}

func testVectorLoading() throws {
Expand All @@ -53,6 +55,7 @@ final class NMAImageFetchTests: XCTestCase {
XCTFail()
}
}
wait(for: [expectationWithoutCaching], timeout: 5)
let expectationWithCaching = expectation(description: "Image request finished with caching")
_ = imageFetch.requestImage(imageFetchRequest) { result in
expectationWithCaching.fulfill()
Expand All @@ -63,7 +66,7 @@ final class NMAImageFetchTests: XCTestCase {
XCTFail()
}
}
waitForExpectations(timeout: 5)
wait(for: [expectationWithCaching], timeout: 5)
}

func testCancel() {
Expand Down

0 comments on commit 64d8905

Please sign in to comment.