Skip to content

Commit fdd36a0

Browse files
committed
Fix the macOS test case
1 parent 62b4f25 commit fdd36a0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Tests/WebImageTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,15 @@ class WebImageTests: XCTestCase {
158158
let imageUrl = URL(string: "https://raw.githubusercontent.com/recurser/exif-orientation-examples/master/Landscape_5.jpg")
159159
let imageView = WebImage(url: imageUrl)
160160
let introspectView = imageView.onSuccess { image, data, cacheType in
161+
#if os(macOS)
162+
let displayImage = try? imageView.inspect().group().image(0).nsImage()
163+
XCTAssertNotNil(displayImage)
164+
#else
161165
let displayImage = try? imageView.inspect().group().image(0).cgImage()
162166
let orientation = try! imageView.inspect().group().image(0).orientation()
163167
XCTAssertNotNil(displayImage)
164168
XCTAssertEqual(orientation, .leftMirrored)
169+
#endif
165170
expectation.fulfill()
166171
}.onFailure { error in
167172
XCTFail(error.localizedDescription)

0 commit comments

Comments
 (0)