Skip to content

Commit a79f8a2

Browse files
Load test credentials relative to source file
1 parent b075bb6 commit a79f8a2

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Tests/AsposeBarcodeCloudTests/AsposeBarcodeCloudTests.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,21 @@ private enum TestConfiguration {
279279
return configuration
280280
}
281281

282+
if let configuration = loadFromFile(sourceRelativeConfigPath()) {
283+
return configuration
284+
}
285+
282286
return loadFromEnvironment(ProcessInfo.processInfo.environment)
283287
}
284288

289+
private static func sourceRelativeConfigPath() -> String {
290+
URL(fileURLWithPath: #filePath)
291+
.deletingLastPathComponent()
292+
.deletingLastPathComponent()
293+
.appendingPathComponent("configuration.json")
294+
.path
295+
}
296+
285297
private static func loadFromFile(_ path: String) -> AsposeBarcodeCloudConfiguration? {
286298
guard FileManager.default.fileExists(atPath: path),
287299
let data = FileManager.default.contents(atPath: path)

0 commit comments

Comments
 (0)