Skip to content

Commit

Permalink
Also dispatch all custom queue to main
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Nov 15, 2017
1 parent 5991a67 commit 51b940e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Tests/KingfisherTests/KingfisherManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ class KingfisherManagerTests: XCTestCase {
}, completionHandler: { _, error, _, _ in
XCTAssertNotNil(error)
XCTAssertTrue(Thread.isMainThread)
expectation.fulfill()
DispatchQueue.main.async {
expectation.fulfill()
}
})
waitForExpectations(timeout: 5, handler: nil)
}
Expand All @@ -243,7 +245,7 @@ class KingfisherManagerTests: XCTestCase {
let customQueue = DispatchQueue(label: "com.kingfisher.testQueue")
manager.retrieveImage(with: url, options: [.callbackDispatchQueue(customQueue)], progressBlock: { _, _ in
XCTAssertTrue(Thread.isMainThread)
progressExpectation.fulfill()
DispatchQueue.main.async { progressExpectation.fulfill() }
}, completionHandler: { _, error, _, _ in
XCTAssertNil(error)

Expand Down

0 comments on commit 51b940e

Please sign in to comment.