Skip to content

Commit

Permalink
show better error message when cache creation fails for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
anitarua committed Nov 30, 2023
1 parent 5a225ed commit a2295b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Tests/momentoTests/testUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ func setUpIntegrationTests() async -> TestSetup {

let cacheName = generateStringWithUuid(prefix: "swift-test")
let result = await cacheClient.createCache(cacheName: cacheName)
if result is CacheCreateError {
throw (result as! CacheCreateError) as! Error
switch result {
case let error as CacheCreateError:
fatalError("Unable to create integration test cache: \(error)")
default:
break
}

return TestSetup(
Expand Down

0 comments on commit a2295b1

Please sign in to comment.