From a2295b14361bc8d7762caaab7d354bea187b5670 Mon Sep 17 00:00:00 2001 From: anitarua Date: Thu, 30 Nov 2023 13:41:22 -0800 Subject: [PATCH] show better error message when cache creation fails for testing --- Tests/momentoTests/testUtils.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Tests/momentoTests/testUtils.swift b/Tests/momentoTests/testUtils.swift index 5181d55..04c5571 100644 --- a/Tests/momentoTests/testUtils.swift +++ b/Tests/momentoTests/testUtils.swift @@ -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(