File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1+ import Foundation
2+
3+ extension Bundle {
4+ static var hardware : Bundle {
5+ #if DEBUG
6+ // Workaround for https://forums.swift.org/t/swift-5-3-swiftpm-resources-in-tests-uses-wrong-bundle-path/37051
7+ if let testBundlePath = ProcessInfo . processInfo. environment [ " XCTestBundlePath " ] ,
8+ let bundle = Bundle ( path: " \( testBundlePath) /Modules_Hardware.bundle " ) {
9+ return bundle
10+ }
11+ #endif
12+ return Bundle . module
13+
14+ }
15+ }
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ import Foundation
3737extension CardBrand {
3838
3939 private var iconURL : URL ! {
40- Bundle . module . url ( forResource: iconName, withExtension: " svg " )
40+ Bundle . hardware . url ( forResource: iconName, withExtension: " svg " )
4141 }
4242
4343 /// Icon that represents the brand in SVG format
You can’t perform that action at this time.
0 commit comments